WpfResourcesApp4 ( WPF )

Objectives:
  •  Assembly Resource type:
    •  assembly = type.Assembly;
  • ShutdownMode="OnLastWindowClose"  will Shutdown the application, when the last window (including MainWindow) is closed
  • **~ Reflection, Frame, Assembly, try-catch
    **~Load Page1 in Frame in MainWindow
    **~ Read command text in Botton
    **~ShutdownMode="OnLastWindowClose"
    **~frame1.NavigationService.Navigate(..)
    **~ Button btn=(Button)e.OriginalSource;
  • Diconary : ResourceDictionary.MergedDictionaries
  •  Navigation with Frame control
    •  Uri uri= new Uri("Page1.xaml",UriKind.RelativeOrAbsolute);
      frame1.NavigationService.Navigate(uri);
  • Code: App.xaml.txt, Dictioary1.xaml.txt, MainWindow.xaml.txt, MainWindow.xaml.cs.txt

Theme

Use of Dictionary

Step:1 Create a New project

Add couple of Window's XAML items as shown below, including a Page1 (XBAP, XAMLBrowser Application Page) .

Add an Image that will be added to Page1.xaml.

 

Step:2 Design pane of MainWindow.xaml

 

Step:3 Code Explained:

a) Current Button control: Accessing the Button control, created  in XAML pane, with Assembly with C# codes in MainWindow.xaml.cs

b) Loading an XBAP Page in an embedded  Frame control of MainWindow

Step:4 Application Shutdown mode

Step:5 Frame to URI

Step:6 Runtime views

a) Default : window first look

b) Window1 Menu / Button Click event

b) No-XBAPI

c)

Step:7
Step:8
Step:9
Step:10
Step:11
Step:12
Step:13
Step:14
Step:15
Step:16
Step:17