TechEd - Windows Presentation Foundation (WPF): Creating Windows and Browser Applications with WPF
This session offered some more insight into the WPF part of .Net Framework 3.0. It did not have many demos but it did offer a good impression of what WPF can and cannot do.
First of all, the session clearly showed that XAML can be hosted in Windows Forms applications as well as browser applications. There is but one requisite for this. You need to have .Net Framework 3.0 running on the client system. This obviously limits the option to use it for browser applications. You can host XAML forms in a browser and you have access to all the cool features, but would you force a user to install the .Net Framework 3.0 before he/she can access your web site? I don't think so.
The application object has become very powerful when you use it in conjuction with WPF. It has a Properties property which is basically a Dictionary object. Here you can store session wide values. These values are available throughout the application. But their lost when the application is closed. But hey, it's a Dictionary object, so you can easily store them in a file (or the registry) and retrieve them when you re-run the application. Other options to persist session valueas are the configuration manager, isolated storage or even cookies. And yes, if you really want, you can use cookies in a WinForms application, but why bother...
WPF can be hosted in the following environments:
- Windows Forms
- Classic MSI applications, always full trust
- ClickOnce deployment, can have full trust.
- Browser hosted
- Loose XAML. A client with .net Framework 3.0 installed can run XAML. but then you don't have control over the application. Always in a sandbox and other security restrictions apply
- XBAP (Xaml Browser Application). This is kind of like a 'normal' web application, but with the restrictions that apply to loose XAML. You do get to control the application though!