Documente Academic
Documente Profesional
Documente Cultură
What Is WPF?
It is a new foundation for building Windows-based applications by using:
Media Documents Application UI Windows Presentation Foundation (WPF) Windows Workflow Foundation (WF) Windows CardSpace (WCS)
WPF Architecture
WPF Core Components
milcore
User32 Kernel DirectX
Unmanaged Code
Stand-Alone Applications
Studio 2008
Defining the Application Defining Windows or Pages Adding Controls Building and Running a WPF Application
Adding Controls
Windows and pages contain controls
The controls are represented by XAML elements <Button> and <TextBox> are examples of these
... <Grid> <TextBox Name="TextBox1" /> <Button Name="Button1">Click here</Button> </Grid> ...
Stand-Alone Application
Browser Application
Gaining focus
Implement event handler method in the code-behind file public void Button1_Click( object sender, RoutedEventArgs e) { MessageBox.Show("Hello WPF"); }
Root element
Child element #2
Bubble
Leaf element #2
Item clicked
<StackPanel Button.Click="CommonClickHandler"> <Button Name="YesButton">Yes</Button> <Button Name="NoButton">No</Button> </StackPanel> private void CommonClickHandler(object sender, RoutedEventArgs e) { Button b = e.Source as Button; ... }
commands
fragments
NavigationProgress
Navigated LoadCompleted FragmentNavigation
NavigationStopped NavigationFailed
Next
Page1.xaml
Page2.xaml
Back
Page1.xaml
KeepAlive property
FrameworkPropertyMetadata.Journal
IProvideCustomContentState
Logon information
Lab Review
Why would you want to inherit your window from the
NavigationWindow class?
are you not able to access the FileName property of the OpenFileDialog class?
Best Practices
Tools