Windows Presentation Foundation

Hello, WPF

WPF from Scratch
Navigation Applications
Content Model
Layout
Controls
Data Binding
Dependency Properties
Resources
Styles and Control Templates
Graphics
Application Deployment
Where Are We?

Layout

Introduction
Layout Basics
DockPanel
StackPanel
Grid
Canvas
Viewbox
Text Layout
Common Layout Properties
When Content Doesn't Fit
Custom Layout
Where Are We?

Controls

Introduction
What Are Controls?
Handling Input
Built-In Controls
Where Are We?

Data Binding

Introduction
Without Data Binding
Data Binding
Binding to List Data
Data Sources
Master-Detail Binding
Where Are We?

Styles and Control Templates

Introduction
Without Styles
Inline Styles
Named Styles
Element-Typed Styles
Data Templates and Styles
Triggers
Control Templates
Where Are We?

Resources

Introduction
Creating and Using Resources
Resources and Styles
Binary Resources
Global Applications
Where Are We?

Graphics

Introduction
Graphics Fundamentals
Shapes
Brushes and Pens
Transformations
Visual-Layer Programming
Video and 3-D
Where Are We?

Animation

Animation Fundamentals
Timelines
Storyboards
Key Frame Animations
Creating Animations Procedurally
Where Are We?

Custom Controls

Introduction
Custom Control Basics
Choosing a Base Class
Custom Functionality
Templates
Default Visuals
Where Are We?

ClickOnce Deployment

A Brief History of Windows Deployment
ClickOnce: Local Install
The Pieces of ClickOnce
Publish Properties
Deploying Updates
ClickOnce: Express Applications
Choosing Local Install versus Express
Signing ClickOnce Applications
Programming for ClickOnce
Security Considerations
Where Are We?

Application Deployment


Application Deployment

Once you've packed all of the features that WPF supports into your application, you still have the challenge of getting it to your users. As part of its effort to merge the best of Windows and the Web, WPF leverages the ClickOnce application-deployment support built into .NET 2.0 to enable WPF applications to be deployed over the Web.

You can deploy your WPF application to a web server for their enjoyment by right-clicking on the project in the Solution Explorer and choosing the Publish option, which brings up the Publish Wizard, which asks you where and how you would like to publish the output of your project.

If you choose the defaults, you'll have chosen to publish a ClickOnce "local install" application to the local machine's web server. A successful publication will bring up a Visual Studio-generated HTML file for you to test your application, as shown in Figure 1-23.

Figure 1-23. Visual Studio-generated publish.htm


This version of publish.htm uses the default settings, including the name of the company of the author who built this sample (which is only coincidently the name of the company that developed WPF), the project name of the application, and the version number for the initial publication of this application.

Clicking on this link deploys the application. The first step is downloading the files that make up the application, as shown in Figure 1-24.

Figure 1-24. Launching a ClickOnce application


Once the files are downloaded, they're checked for a certificate signature from a known publisher. Since this requires nondefault settings, what you'll see is Figure 1-25.

Figure 1-25. Launching a ClickOnce application from an unknown publisher


The Security Warning dialog is shown when the user hasn't already awarded a publisher the permissions to take certain liberties on their computer or when the publisher isn't known at all. If the user presses the Cancel button at this point, no potentially "evil" code has been downloaded or executed. If the user presses the Install button, the application's files are put into the right place, a Start menu folder is established and the application itself is executed, just like a normal WPF application.

If the user can establish a connection to the web server, subsequent runs will detect application updates and offer to upgrade the user's copy of the application, providing them a way to roll back to previous versions (or even uninstall completely) using the Add or Remove Control Panel. Also, even if there is no network connection, since the application is locally installed, no connection is needed to launch the application from the Start menu.

Those of you with trusting souls will now be thinking to yourself, "Wow! What an easy way to get bits out to my users and keep them up to date with the latest features and bug fixes!" and you'd be absolutely right; that's exactly what ClickOnce was designed for and why WPF was specially engineered to work with it.

Those of you with suspicion in your hearts will now be thinking, "Wow! What a great way for naughty men to format my hard drive, send incriminating email to my boss in my name, or reset my Minesweeper high scores!" and you'd be right, too except that ClickOnce applications run in the .NET Code Access Security sandbox.

As of this writing, WPF locally installed ClickOnce applications require "full trust" (which is .NET-speak for "I have always depended on the kindness of strangers"), but this will not be the case for the release of WPF 1.0.


This has been the quickest possible overview of ClickOnce deployment of WPF applications. For much more detail on WPF application deployment, including express applications that are deployed over the Web and hosted in the browser, please read Chapter 10.


©2008 FAQ - WPF Labs - Discuss - Terms of Use - Privacy Policy - About WPF
- Interview Questions - Sharepoint Articles - Interview Questions Resource Library - All about LINQ - MS Knowledgebase Articles - Electronics and Hardware discussions