Structuring and Deploying an Application Tilak Patel Structuring

  • Slides: 28
Download presentation
Structuring and Deploying an Application Tilak Patel

Structuring and Deploying an Application Tilak Patel

Structuring and Deploying an Application • No single canonical way to structure a WPF

Structuring and Deploying an Application • No single canonical way to structure a WPF application. – Standard windows application taking full advantage of local computer – Web based application restricted by internet zone security and still providing compelling experience. – Lot of other variations on same themes.

Behind the scene • WPF window is really just a Win 32 window under

Behind the scene • WPF window is really just a Win 32 window under the covers. • Operating system can not distinguish between windows with WPF content and win 32 content. • Like previous win 32 -based UI frameworks, WPF requires the main thread to live in singlethreaded apartment to enable seamless interoperability and to make programming simpler.

The Application class

The Application class

Using Application. Run

Using Application. Run

Everything in XAML Where is my main method ? ?

Everything in XAML Where is my main method ? ?

Behind the scene Autogenerated Main method in App. g. cs (hidden file !!) Where

Behind the scene Autogenerated Main method in App. g. cs (hidden file !!) Where are my command line arguments ? ? Two different ways to get around this: 1. Forego defining an Application-derived class in XAML, so you can manually define the Main method with a string array parameter. 2. Call System. Environment. Get. Command. Line. Args at any point in your application

Properties Collection • Something very similar to application state or session state in ASP.

Properties Collection • Something very similar to application state or session state in ASP. NET • It is a dictionary for conveniently storing data (as key/value pairs) that can be easily shared among windows or other objects rather than defining public fields or properties.

MDI applications using WPF • MDI stands for Multiple Document Interface. • No built-in

MDI applications using WPF • MDI stands for Multiple Document Interface. • No built-in support for creating MDI user interface. • Windows Forms classes have built in support for MDI so use interoperability techniques to get MDI in WPF application

Digging deeper

Digging deeper

Digging deeper

Digging deeper

Deployment: Click. Once Vs Windows installer

Deployment: Click. Once Vs Windows installer

Deployment: Click. Once Vs Windows installer

Deployment: Click. Once Vs Windows installer

Navigation-Based Windows Application • Content organized in Page elements. • Pages can hosted in

Navigation-Based Windows Application • Content organized in Page elements. • Pages can hosted in – Navigation. Window – Frame • These navigation containers provide a way to navigate from one page to another, a “journal” that keeps track of navigation history and a series of navigation related events.

Navigation-Based Windows Application

Navigation-Based Windows Application

Navigating from page to page • Three main ways to perform navigation: – Calling

Navigating from page to page • Three main ways to perform navigation: – Calling the Navigate method – Using hyperlinks

Navigating from page to page – Using the journal

Navigating from page to page – Using the journal

Navigation Events

Navigation Events

Navigation Events

Navigation Events

Applications with Vista look and feel • Task Dialogs

Applications with Vista look and feel • Task Dialogs

Applications with Vista look and feel • Aero Glass

Applications with Vista look and feel • Aero Glass

Applications with Vista look and feel • Aero Glass

Applications with Vista look and feel • Aero Glass

Gadget-style Applications Creating non rectangular windows:

Gadget-style Applications Creating non rectangular windows:

Gadget-style Applications

Gadget-style Applications

Gadget-style Applications

Gadget-style Applications

Gadget-style Applications

Gadget-style Applications

XAML browser applications • WPF supports creation of applications that run directly in a

XAML browser applications • WPF supports creation of applications that run directly in a web browser ( WPF/E ) • They are called XAML browser applications (XBAPs) and have a. xbap file extension • Same programming model for XBAP. • Main differences:

References • Windows Presentation Foundation Unleashed by Adam Nathan

References • Windows Presentation Foundation Unleashed by Adam Nathan