160 likes | 273 Views
Module 9 Integrating Localization and User Assistance Features. Module Overview. Understanding Localization and Globalization Implementing User Assistance Features Providing User Accessibility Features. Lesson 1: Understanding Localization and Globalization.
E N D
Module 9 Integrating Localization and User Assistance Features
Module Overview • Understanding Localization and Globalization • Implementing User Assistance Features • Providing User Accessibility Features
Lesson 1: Understanding Localization and Globalization • Understanding the WPF Localization and Globalization Features • Implementing Localized WPF Applications by Using the LocBaml Tool • Implementing Localized WPF Applications by Using Strongly Typed Resources
Understanding the WPF Localization andGlobalization Features WPF provides several localization and globalization features: • Automatic layout • Localization attributes and comments • Bidirectional content support • FlowDirection property • Number substitution • Localized content in satellite assemblies • Character references • Encoding • Language attribute • Unicode
Implementing Localized WPF Applications by Using the LocBaml Tool Localizing WPF applications by using the LocBaml tool: • Develop your application • Specify development language in the project file • Add UIDs to your XAML files • Build the application to generate the neutral resource assembly • Copy LocBaml.exe to your bin\debug folder • Parse the satellite resource assembly to generate a CSV file • Translate the extracted content and save it to a new CSV file • Create a folder for the new language resource assembly • Use the LocBaml tool to generate the new resource assembly • Copy the new assembly to the new folder • Test the satellite assembly
Implementing Localized WPF Applications by Using Strongly Typed Resources Main assembly Application folder Satellite assemblies Culture-specific subfolders Satellite assembly MyApplication.resources.dll \de-DE Main assembly MyApplication.exe de-DE resources Neutral resources Satellite assembly MyApplication.resources.dll en-GB resources \en-GB
Lesson 2: Implementing User Assistance Features • Implementing Context-Sensitive Help • Implementing User Assistance Features by Using Tooltips
Implementing Context-Sensitive Help F1 F1 <Window x:Class="MyApplication.MainWindow" ...> <Window.CommandBindings> <CommandBinding Command="ApplicationCommands.Help" Executed="Help_Executed" /> </CommandBinding> </Window> private void Help_Executed( object sender, ExecutedRoutedEventArgs e) { Help.ShowHelp( null, "/help/help.chm", HelpNavigator.TableOfContents); }
Implementing User Assistance Features by Using Tooltips Providing user assistance by using tooltips <Button Command="MySubmitCommand" Content="Submit"> <Button.ToolTip> <StackPanel Orientation="Horizontal"> <Image Height="24" Source="Images\help.png" /> <TextBlock Text="Submit your information" /> </StackPanel> </Button.ToolTip> </Button> Submit Submit your information
Lesson 3: Providing User Accessibility Features • Understanding WPF Accessibility Features • Implementing Accessibility Features in WPF Applications
Understanding WPF Accessibility Features You use layers of features to provide accessibility: • Operating system settings • Application-specific accessibility features • Automation APIs such as Microsoft UI Automation • Assistive technology tools Perform the following tasks to test accessibility: • Verify the UI with a high DPI display • Verify the UI with high-contrast settings • Use verification tools such as UIA Verifier and AccChecker • Verify the UI by using the Magnifier.exe tool • Ensure that the UI controls are accessible from the keyboard
Implementing Accessibility Features in WPF Applications In your custom control class: • Override the OnCreateAutomationPeer method • Raise automation events for control state changes • Raise automation events for property value changes In your custom automation peer class: • Override the GetPattern method • Override the "Core" methods • Implement pattern providers
Lab: Localizing a WPF Application • Exercise 1: Preparing for Localization by Using the LocBaml Tool • Exercise 2: Localizing Resources by Using the LocBaml Tool • Exercise 3: Preparing for Localization by Using Strongly Typed Resources • Exercise 4: Localizing Resources by Using Strongly Typed Resources • Exercise 5: Choosing a Localization Approach Logon information Estimated time: 90minutes
Lab Scenario You have been asked to update the Work Orders application so that it can be distributed around the entire organization. This means that you have to prepare the UI for different regions around the world and take into account all of the aspects of a global application. However, first, you must decide on the best localization approach to take. Having looked at the available options, you have decided that there are two possible approaches to take for this application: using the LocBaml tool or using standard resource files and static data bindings. You decide that you will create a prototype of both options to help the company make the correct decision.
Lab Review Review Questions • Which property do you specify in the project file to define the default culture? • Which markup extension do you use to bind to localized resource properties when you implement localization by using strongly typed resources?
Module Review and Takeaways • Review Questions • Best Practices • Tools