Free mag vol1 | Page 44

 CONTENTS The Role of BAML ............................................................................................................................... 1124 Mapping the Application XAML Markup to C# Code ........................................................................... 1125 XAML-to-Assembly Process Summary ............................................................................................... 1126 Understanding the Syntax of WPF XAML .....................................................................1127 Introducing Kaxaml............................................................................................................................. 1127 XAML XML Namespaces and XAML “Keywords”................................................................................ 1128 Controlling Class and Member Variable Visibility ............................................................................... 1131 XAML Elements, XAML Attributes, and Type Converters .................................................................... 1131 Understanding XAML Property-Element Syntax ................................................................................. 1133 Understanding XAML Attached Properties.......................................................................................... 1133 Understanding XAML Markup Extensions........................................................................................... 1134 Building a WPF Application Using Code-Behind Files..................................................1136 Adding a Code File for the MainWindow Class ................................................................................... 1136 Adding a Code File for the MyApp Class............................................................................................. 1137 Processing the Code Files with msbuild.exe ...................................................................................... 1138 Building WPF Applications Using Visual Studio ...........................................................1139 The WPF Project Templates................................................................................................................ 1139 The Toolbox and XAML Designer/Editor ............................................................................................. 1141 Setting Properties Using the Properties Window.......... ...................................................................... 1143 Handling Events Using the Properties Window................................................................................... 1145 Handling Events in the XAML Editor ................................................................................................... 1146 The Document Outline Window .......................................................................................................... 1146 Viewing the AutoGenerated Code Files............................................................................................... 1147 Building a Custom XAML Editor with Visual Studio .....................................................1148 Designing the GUI of Our Window....................................................................................................... 1148 Implementing the Loaded Event......................................................................................................... 1150 Implementing the Button’s Click Event............................................................................................... 1151 Implementing the Closed Event.......................................................................................................... 1153 xlii