Archive for the 'Avalon' Category

Page 4 of 6

WinFX January CTP

The WinFX January CTP just made it to MSDN. Here are links to all the goods:

Have fun. :)

And finally, if you are wondering why the Go-Live includes WF and WCF but not WPF, Arik Cohen (release/community PM extraordinaire, and one of the decision-makers on this topic), has posted some of the background that led to that decision. He also welcomes questions and comments about this if you have any.

Configuring Apache to Serve Avalon

The WinFX online SDK has a nifty little article that explains how to configure IIS to serve up WPF (aka Avalon) content. At the heart of this article is the fact that the following 5 extension-MIME type mappings need to be made:

Extension MIME Type
.manifest application/manifest
.xaml application/xaml+xml
.application application/x-ms-application
.xbap application/x-ms-xbap
.deploy application/octet-stream

The instructions in the article work like a charm if you’re (1) running IIS and (2) have administrative capabilities on your server.

Since I’m just paying a company in Texas for a bit of space on the web, I am (1) running Apache and (2) only have my little non-privileged user account. But if you are like me, do not despair! Eric, one of the developers on my team, realized that one could do the MIME-type mapping by adding the following lines to his/her .htaccess file:

AddType application/manifest manifest
AddType application/xaml+xml xaml
AddType application/x-ms-application application
AddType application/x-ms-xbap xbap
AddType application/octet-stream deploy

I just tried this out, et voila, now I can deploy XBAPs from my site. If you have the December CTP installed (if not, go get it here), here’s a Hello World for you to try out.

Update 2/9/06 11:45am: One of my co-workers reported that he had to put a period before the extension (e.g. “.xaml” rather than “xaml”) in his .htaccess file to get this working on his server. YMMV.

WPF Resource Loading

Ashish has some very informative recent posts about resource loading in WPF.

This stuff is important to just about anyone writing a WPF application, and I don’t think it’s hit MSDN yet. It’s a pretty nice model — you can just use URIs for everything, and there are abstractions that enable you to be agnostic of hosting model (browser/standalone), packaging model (loose/embedded), and site of origin (the location from which the application was deployed).

WinFX November CTP

I am really late to post this, but: the November CTP of WinFX is available on MSDN (and has been since late November :)). One exciting thing about this release is that it works with the RTM releases of Visual Studio 2005 and Visual Studio Express. So go get your Workflow, Communications, and Presentation fix if you haven’t already!

Nathan on Navigation Transitions

Nathan has a great post today about how to create navigation transitions. He even posted a WBA that shows it off, so you can just go run this if you have the September CTP installed.

What Happened to NavigationApplication?

I’m not sure how many of you at PDC have already installed “The Goods” CD that you received. When you do, and you start porting your WPF apps to this build, you’ll notice that the NavigationApplication class no longer exists. Don’t panic! All of the navigation features that you know and love are still around, and their usage model hasn’t changed much either. Before I go into too much detail on the change, here’s some background on the problems we had with the old Application/NavigationApplication split:

  1. The decision of Application vs. NavigationApplication has little to do with whether or not the app uses navigation – Applications may use NavigationWindows, and NavigationApplications may use regular Windows. So why make the choice? Since the decision of whether or not to use navigation really happens at the Window level, not the app level, we’d rather let developers make the decision per window.
  2. There was no way to create a markup-only application using the vanilla Application class.
  3. When using NavigationApplication and setting the StartupUri, there was no way to set properties on the MainWindow before it was shown.
  4. People were confused about when to use an Application vs. a NavigationApplication. This is in large part because there were only 3 main differences between the two: Startup behavior, the Properties collection, and Navigation events.

Given these known drawbacks, we set out to provide one Application class that solves the problems above and still meets all of your app-management needs. The main changes are as follows:

  • Moved StartupUri to Application – providing this property on the Application object maintains the existing startup behavior for NavigationApplications, and helps us enable the markup-only non-navigation Hello World scenario.
  • Changed how StartupUri works – if the XAML specified has a Window at the root, we’ll create the Window (no navigation occurs); if the file has a Page at the root, we’ll create the NavigationWindow implicitly and navigate to the Page.
    • Window –> create the Window (don’t navigate)
    • NavigationWindow –> create the NavigationWindow (don’t navigate)
    • Page –> create NavigationWindow and navigate
  • Moved Navigation events and Properties collection to Application

In general, most people have found the change relatively easy to adapt to, and they are appreciative of this simplification of the API. The most common migration path will simply be replacing your <NavigationApplication> tags with <Application> tags — and then everything should just work as it did before. If it turns out to be more difficult for you, or you have any questions about how to migrate, please let me know.

Logistical Details for My PDC Session

I posted the abstract for my talk about a month ago, but now we actually have all the logistical information available too:

PRS314 – Windows Presentation Foundation (“Avalon”): Using Application Services
September 14, 5:00 PM – 6:15 PM
150/151 (Hall E)
Lauren Lavoie

Learn how to use Windows Presentation Foundation (formerly codename “Avalon”) application-level services for data management, system interaction, hosting, and UI to create great client applications. See how to create both standalone client applications and rich browser applications that can take advantage of these services. Gain guidance for using application-level services, such as when your application should be hosted in the browser or a standalone window, whether or not to write a navigation-based application, and how to manage application data and settings for various scenarios.

I hope to see you there next Wednesday!

PDC Bloggers

A great place to check out all the PDC action (whether you’ll be at the Convention Center with us or not) is PDCBloggers.net. They have aggregated feeds from speakers, staff, attendees, and community members. I expect that you’ll see tons of good WPF content over there during the coming week.

Why Doesn’t WPF Support MDI?

A few people have asked me why the WPF builds that we’ve released don’t include support for MDI. On one hand, I still want to do this for V1. On the other, I can’t imagine making people wait any longer before we ship this thing, on account of adding “just one more feature.”

I do want to call out that the absence of MDI support in WPF does not at all imply that we don’t think this is important. Nor does it mean that we can’t add it in the next version if it doesn’t make it in for V1. There are a couple of factors influencing this decision:

  • Shipping. As I’m sure you know, software projects are always a game of making tradeoffs. Tradeoffs between features and other features, between features and bug fixes, between features and ship dates, and so on. MDI will be a huge feature if we implement it right (and implementing it right in this case means making it a true first-class citizen of WPF, so that it integrates well with styling, the property system, etc.), and at some point we had to decide between adding this new large feature and shipping the product.
  • Chocolate or vanilla? There are probably about 20 “flavors” of MDI. Word does MDI differently from Excel, Excel does MDI differently from Visual Studio, Visual Studio does MDI differently from Firefox (and yes, you might have caught on to my implication that I think tabbed browsing is just another flavor of MDI), Firefox does MDI differently from OneNote. In fact, a lot of apps use their own custom plumbing for MDI because the flavor provided by the API platform isn’t quite the right one. Before we go implement something as monolithic as MDI, we want to make sure that we choose the right flavor — or do it in a flexible enough way so that our developers can customize it to meet their needs. I don’t think any of us really knows the right way to do this yet — a big part of this needs to come from understanding the needs of customers who are actually building on WPF (that’s you, and hence the ask for feedback at the end of this post).

So what if you want to build an MDI app now? Not all is lost, because there are ways around the limitation. Here are the two that I expect to be most common:

  1. Use Windows Forms interop. Nick Kramer describes how to do this, with a quick code sample, in this blog post.
  2. Bake it yourself. This is not as impossible as it sounds. In fact, a lot of apps out there do this today, because they want a different “flavor” of MDI than what comes out of the box with Win32/MFC/WinForms. Chris Anderson’s AvPad makes use of a custom implementation of a child window manager, and Chris claims it wasn’t hard to do. <g>

If there is sufficient interest, I’d be very happy to write up a sample for current external bits showing #2 above — using Chris’s AvPad as a starting point, but really highlighting how to write the child window manager code. My only caveat is that this would happen after PDC. :)

I’d also love feedback from those of you who are hurting by not having this support now. In particular — what’s your scenario, and what “flavor” of MDI are you looking to produce? Is it more like Excel, Word, Visual Studio, or something else entirely?

PDC Panel: What’s Next for Microsoft’s Web Platform

I’ll be participating in the following panel at the PDC next week:

PNL06 – What’s Next for Microsoft’s Web Platform
September 16, 8:30 AM – 10:00 AM
152/153 (Hall F)
Eric Deily, Eric Feagler, Lauren Lavoie, Mike Volodarsky, Nikhil Kothari, Omar Khan, Shanku Niyogi

Will emerging technologies such as Atlas and IIS7 create an environment for new types of web applications, if so what challenges and opportunities will developers face? How is ASP.NET evolving? What role will Avalon Express play in this space? Join us for a conversation with a panel of Microsoft experts on what promises to be a lively discussion on the state of web application development.

This should be an exciting panel. We plan to make it worth getting up early for. :)

If you have any questions that you’d like to hear us answer during this panel, please either leave a comment or drop me a line.