WpfAppType2 ( WPF ) |
Objectives:

- Resources XAML:
- <Application.Resources>
<SolidColorBrush x:Key="BackgroundColor"
Color="Bisque"></SolidColorBrush>
- Code :
|
Application is a class that encapsulates WPF application-specific
functionality, including the following:
•Application Lifetime Related : Activated, Current, Deactivated,
DispatcherUnhandledException, Exit, Run, SessionEnding, Shutdown,
ShutdownMode, Startup.
•Application-Scope like Window, Property, and Resource Management:
FindResource, GetContentStream, GetResourceStream, LoadComponent,
MainWindow, Properties, Resources, StartupUri, Windows.
•Command-Line Parameter and Exit Code Processing:
Application.Startup, Application.Exit, Application.Shutdown.
•Navigation: FragmentNavigation, LoadCompleted, Navigated,
Navigating, NavigationProgress, NavigationStopped, NavigationFailed,
SetCookie, GetCookie.
|
Step:1 Create a New project


Project Created by default, contains "WPF -Windows-Application", which is very
similar to "Windows Form Application" . This Template also provide few other
flavors, and we we going to explore one at a time`. To date,
WPF-Windows-Application is a fare alternate choice to the classical
Windows-Form-Application , with XAML coding and conventional coding which marks
it's separation from windows-form-application.

Code-Behind-MainWindow

App.xaml: Reference point of application resources.

Code behind of App.xmal

 
|
Step:2 Life and regulation of
Window and it's options. You may convert into a Navigational or Page Application
type.

|
Step:3 Edit Code in
a) App.xaml: App.xaml.1.txt to
App.xaml.2.txt

b) Edit App.xaml.cs

|
Step:4 Runtime Viewsa)
App_StartUp




Window is displayed

Since two "Message-Boxes" in "App_Startup" padded the object created from "MainWindow",
the cursor returns to the Application Pane-Module and displays the second
message.

b) The events involved in Closing "MainWindow". First the local object will
tend to close and

The illustration below shows how the cursor shifts from "MainWindow"
to "Application Class".



|
Step:5 Notes:
|
|