Beruflich Dokumente
Kultur Dokumente
Windows Presentation
®
Foundation
Module 2: Building User Interfaces
• Defining Page Layout
Child objects
Layout class
Canvas
DockPanel
Panel
Grid
Background
Children StackPanel
ZIndex
VirtualizingStackPanel
WrapPanel
Demonstration: Defining Layout by Using Panels
In this demonstration, you will see how to:
• Use the Canvas class
• ToolTip
Button
Multiple
objects
Demonstration: Creating a User Interface by
Using Content Controls
In this demonstration, you will see how to:
• Use the ContentControl class
TabItem
header
• GroupBox
• TabItem Expander
Demonstration: Creating a User Interface by
Using Headered Content Controls
In this demonstration, you will see how to:
• Use the TabItem class
Items
• ListBox
Can be • Menu
different types
• StatusBar
• TabControl
• Contains multiple objects
• ToolBar
• Has an Items property
• TreeView
• Has an ItemsSource property
Handling Item Selection
<ListBox
SelectionChanged="ListBox1_SelectionChanged">
...
</ListBox>
Examples:
• DataGridView
• DateTimePicker
• FolderBrowserDialog
• NotifyIcon
Referencing Windows Forms Controls in a WPF
Application
System.Windows.Forms
assembly
WindowsFormsIntegration
WPF Application assembly
Using Windows Forms Controls in XAML
WindowsFormsHost
element
DateTimePicker
child control
• Manipulate properties
(this.wfh.Child as DateTimePicker).ValueChanged +=
new EventHander(Window1_ValueChanged);
Lab: Building User Interfaces
• Exercise 1: Defining Page Layout and Adding Content
Logon information
Virtual machine 6460A-LON-DEV-02
Password Pa$$w0rd
• Tools