Hillberg on XamlWriter

Mike Hillberg has a great writeup on the XamlWriter built into .NET 3.0.

WPF flow document editor (oh, and DOCX)

Rob Relyea points to the new OpenXML.biz editor...

TechEd 2007

I'm suggesting a session for TechEd 2007... this is my attempt to influence the judges by winning popular support for my talk:

Title: XAML as a better C#

Abstract: .NET 3.0 introduces a new technology enabling declarative programming. This session will focus not only on the built in runtimes (WPF and WF) but also applying the technology to other domains (eg. WCF, ASP.NET, System.Configuration, or better yet, your application domain)

I've been thinking a lot lately about XAML as more than just WPF, WPF/E, or WF... I think that more broadly XAML is the begining of a much richer declarative programming model. This new declarative model will (hopefully) raise the abstract level for developers and allow for better tools, interoperability, and ... well... basically make the world a better place. :)

WPF/E Feb CTP

Late to the "congrats" party, but the WPF/E folks released their latest CTP. Michael Harsh has posted a new version of WPF/E Pad that runs on the new bits... Windows and Mac, of course.

More XBAPs, from Japan

They are popping up everywhere... especially in Japan:

While I don't normally do a lot of makeup shopping the Shiseido site is very cool in terms of transition and video effects.

[Links from Aaron Goldfelder in email, thanks!]
[7:29am: fixed typo in the last sentance above... it's too early to post, apparently]

WPF/E... rocks!

Check out this WPF/E sample, that simulates Vista... [from Savas]

StandOut

This looks very cool - a new twist on presentation software. I"m somewhat frustrated by PowerPoint - the latest version is absolutely fabulous. I love the new graphical treatments. The templates are very nice. However, it still lacks the fluidity and polish that I see possible with WPF. I can't wait to try out StandOut to see if it can really produce something as nice as what I'd like to see.

Rules driven UI

Interesting sample... unfortunately the setup for it was too involved, but I love the idea of driving more UI from a set of shared rules.

Congratulations!

It's great to see Vista release. I spent a lot of time working on WPF, which I believe is one of the core parts of the new Vista experience. The Avalon team, depending on how much of the organization you include, peaked at around 250 people, with another 250 people working in the "Windows Client Platform and Documents" team that Avalon was part of. It was a massive effort. The overall team built features ranging from the XPS document format, the desktop window manager, WPF, and the Windows Imaging Components (WIC) - to name just a few.

I'm proud of what this team accomplished, and I'm extremely proud to have been part of that team.

Congratulations to everyone who contributed to this release. I know we would have all liked to see it get out the door before now, but we have a lot to be proud of.

... now, let's get back to work and make it even better!

Expression

Blend and Design go beta, congrats! (from Karsten)

WPF XBAP

No, not alphabet soup... rather a set of cool apps that have a seamless installation experience and run in the browser. Secure, full power of the platform... i love it.

Karen Corby, a fabulous PM on the Avalon team, wrote a great post about the security of XBAPs. Chris Sells and I got in a big debate about how much detail my book should go into this kind of detail. In the end I felt the deep dive into custom security policy was out of scope for a book like mine (more about the overall structure and conceptual model of the platform), but an API reference or deep dive book would be a better place for this.

While they don't appear to have a lot of content yet, XBAP.org looks like it might become an interesting place to search...

 

The perfect WPF workstation

Tim lists his favorite configuration...

Happy Holidays

Episode 4 of Don and I singing... you didn't ask for it, but you got it!

WPF/E Logo

Pretty cool. I used Microsoft Expression Design to create a WPF logo (hack) for my book. Very cool stuff.

Test WPF/E post

If all goes well, this should say "Hello from WPF/E"

Can you view XPS without .NET? Of course!

Want to read the pages from Essential WPF but you don't want to download the .NET 3.0 RC1 bits... well, I missed the announcement but Rob forwarded me Andy's article linking to the XPS Team's announcment of the XPS document viewer Beta 2 - which reads XPS without the .NET Framework... (links to links to links, oh my!)

Thanks Rob, Andy, and the XPS Team!!

WinFX... err... .NET Framework 3.0 RC1

Yes, it's finally available... WPF, WCF, and the rest of .NET 3.0 shipped RC1 today (including the RC1 SDK). Wahoo!

PS: old news, and not related to .NET 3.0... the PowerShell RC1 bits are also on the web.

Kevin Moore goes sample crazy

Kevin just released about eleventy-billion samples up on netfx3...

Book-acation: Day 5

The appendix is done!

Well, kinda.

My goal with the appendix is to cover the nitty gritty of the most critical base services in Avalon. Things like the property system and input system. Because it's more of a reference tone, instead of the conceptual stuff in the rest of the book, it's quite a bit easier to write. I also had already written about half of it.

The "kinda" part is that I'm going to ask my reviewers for other suggestions of topics that should be in the appendix.The sections as of now are:

  • Threading and dispatchers
  • Properties
  • Keyboards, Mice, and Styluses

Any other big sections missing? The bulk of "core" concepts are covered in the rest of the book, so this is really designed to be a deep dive into some particularly interesting features...

Taking this time off to focus on finishing the book is probably the best use of vacation time that I've done in a long time. Each day I've given myself about 1-2 hours of errand time, so I've caught up on a lot of stuff that had been building up. In addition I feel like this enormous weight of completing this project is finally off me. I know that reviewing and editing of the manuscript is a big task, but I feel that it's achievable now.

I'm going to have a margarita at lunch!

Book-acation: Day 4

Done with the introduction. Wow.

With that, I'm done with the "body" of my book. At least the first draft. I still have an appendix to write, a lot of cleanup, and reviews to go through. I'm working on a deal to hire out some of the scrubbing of the book into a final form, but having the body content done is a massive accomplishment (for me).

Right now the book weighs in at 284 pages with out the appendix. My guess is that once I finish reviews i'll tip just north of 300, which was my goal. Originally I started out with a 600 page goal, but after talking with people I realized that not even I would want to read a book that long about Avalon! :-)

I'm going to get lunch, and run by Kinko's to print 3 copies of my first draft of the entire book. I'm pretty excited to see the entire thing on paper. My last draft that I printed the entire thing was on July 6, which was in a different format and had less than half the content I have now.

When I get back from lunch I'll start digging into the appendix.

Book-acation: Day 3

I managed to finish up the styles chapter, and begin work on the introduction yesterday. Today I got about a solid 6 hours of work (acceptable for an 8 hour shift). As of now I have 22 pages of content written on the introduction, with about 8 or so left to write. I should be able to get that done before lunch tomorrow. The introduction is much easier to write because it's basically a road map to the rest of the book, which is all written.

After I finish the introduction I have two options as to what I do. 1) write the appendix "Base Services" that covers threading, property system, etc. or 2) update all the chapters to the Feb CTP bits. I guess there is a third option also; 3) work through the feedback from Michael on the chapters he's given me feedback.

Of these, the least appealing is writing the appendix, but I have a feeling it's the right thing to get done.

Book-acation: Day 2

Yesterday turned out to only be a half-day on the book, there were a couple of critical work meetings, so I did a 50/50 split. I still managed to get about 7 pages finished, which at least kept me from getting too far behind.

Today I have a noon meeting, so this is my half way check point. I've finished almost all of the content for the styles chapter, I have a total of 15 pages done (8 written today), and I figure this afternoon I should be able to easily finish up the rest of the chapter (only one or two pages left), and get started on the Introduction.

I'm going to finish the introduction then move to the appendix, which will cover some gritty details of the platform.

Here is a question for any readers that are left out there (after you don't post for months readership drops off)...

What do you think about the title "Essential Windows Presentation Foundation" or "Essential WPF" for short?

Book-acation: Day 1

I'm taking a week off of work to (hopefully) finish my book. I've set up some rules for myself...

1) Treat it as a job - show up on time, and finish. I figure that because I'm working from home I could be tempted to put in 20 hours the first day, then start slacking off. I want to put ~50 hours into the book this week, not 100.

2) When working, no work. That is, no Microsoft work when working on the book. I'm burning vacation time to do the book (something I said I'd never do). I'm not going to burn vacation time *and* work!

That's about it. Today I'm working on my final content chapter - Styles. Hopefully I'll finish that in the next couple days, then I can write the Intro chapter, which should be another 25-30 pages. If I can get both of these chapters done this week I'll be golden.

Chess in WinFX

Valentin has an amazingly cool chess game in WinFX... if you have the Feb CTP installed you can just run the application in the browser with no prompts! :)

Quick update

Two months with no posts. That's a while. I won't bore you all with the reasons, but I think I'm back.

A quick status report...

1. My machine that runs NewsGator for Outlook lost it's connection (working on it), so I haven't been reading blogs for a while. I think I'm going to try and use the new Outlook features for RSS as my aggregator.

2. The book is still not done. I'm taking a week off of work this month to try and close it down.

3. I haven't done any diving, but I have gotten out on the boat a bit. The house project is ramping up (been to the county offices a couple times now). My HD TiVo is dying and needs to be replaced.

Also, I've moved offices... I now sit right across from Don, and virtually sit next to Sells. I'm still working on technologies related to WinFX and close to Avalon, however I'm focusing more on some longer term investments (more later on this).

Steel cage death match of Avalon authors

Rory delivers... while Ian Griffiths is missing from the picture (sorry about that Ian, I love you man, really!), the US contigency is well represented in Rory's comic.

Thanks for the art Rory!!!

My favorite part is Don's ability in the comic to continually simplify the problem of programming languages until he gets to "I wrote binary with one line of unary"... comedy gold.

3D Tools

Daniel released a new version of his 3DTools project... now for the December CTP. Cool stuff.

Hierarchical Binding

Today I spent some solid time working on the book (9 pages, wahoo!) and worked on a bunch of data binding topics. While it didn't make the book, I really liked this sample I wrote up for showing hierarchical binding.

I started out with a chunk of XML:

      <Media xmlns="">
        <Book Author="John" Title="Fish are my friends" />
        <Book Author="Dave" Title="Fish are my enemies" />
        <Book Author="Jane" Title="Fish are my food" />
        <CD Artist="Jane" Title="Fish sign good" />
        <DVD Director="John" Title="Fish: The movie">
          <Actor>Jane</Actor>
          <Actor>Dave</Actor>
        </DVD>
      </Media>

What I wanted to do was data bind it into a TreeView that would show the structure of the XML... so effectively I wanted:

<Grid 
    xmlns="http://schemas.microsoft.com/winfx/avalon/2005" 
    xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005">
  <Grid.Resources>
    <XmlDataProvider x:Key="dataSource">
      ... xml ...
    </XmlDataProvider>
  </Grid.Resources>
  <TreeView 
      ItemsSource="{Binding Source={StaticResource dataSource}}" />
</Grid>

Part of the data binding support in WinFX is native support for hierarchical binding. Basically if you have some data that has hierarchy, and a control that has native hierarchy support, you can wire the two together without a lot of fanfare. The trick is the HierarchicalDataTemplate, which lets you specify how to walk the object graph to produce the hierarchy. What's even better, that because of the automatic look of data templates based on types, you can make this extrememly simple:

        <HierarchicalDataTemplate 
            DataType='{x:Type sx:XmlNode}' 
            ItemsSource='{Binding Path=ChildNodes}'>
                
            <TextBlock Text='{Binding Path=Name}' />
        </HierarchicalDataTemplate>

That's it. With that data template as the ItemTemplate for your TreeView, you will get a complete dump of the template. The content of the HierarchicalDataTemplate is the display tree for the item, and the ItemsSource property controls where the template will get the next level of the hierarchy. Since ChildNodes returns something that is an XmlNode, the template automatically recurses. Pretty cool, huh?

With a little fancier template, you can get something like this:

XAML Source

Obligitory new year post

I started blogging on December 23, 2002, and have had various levels of success in keeping up with my blog. Because my blog-iversary falls close to the new year, it's nice to use it as a good summary and look forward.

2005

What a great year. Some tough stuff, but overall a great year. I worked with the Eastlake Robotics Club (hardware, what a concept), started writing a book, traveled to Italy and China, got my advanced scuba diver certificate, bought a boat. All fun stuff. We started our adoption paperwork as well as began the IVF process.

I made the resolution for more balance in 2005, and I actually think I hit it. I've spent a lot of time at work, with the family, with friends, and on my own. I've been camping, snowmobiling, boating, diving, and traveling this year, a great balance.

2006

Looking forward, this is going to be an exciting year. We are almost certaintly going to have a child this year. Vista will ship this year. I'll publish a book this year. We are building a big covered dining area on our house.

At work I've already started to look forward at the future of Avalon and WinFX. I think there is some amazing new areas for us to investigate, and great new opportunities to really raise the bar for the platform for building smart client applications.

OK, a few goals, objectives, resolutions, etc:

  • Get a baby
  • Finish the book on time (well, the new schedule at least)
  • Use the boat - goal of 3 trips through the locks, and 50 hours on the lake
  • Dive more - lets set a goal of 24 dives in 12 months
  • Get the dining area built by July
  • No new hobbies (04 I started diving, 05 I started boating, lets have 06 be a neutral year of hobbies)
  • Do more work on the house (fix the molding, buy furniture, etc.)

Historical

 

December CTP... with Cider!

The latest WinFX bits are now available, the December CTP. A big piece of news in this release - the availability of a visual designer for Visual Studio users, code named "Cider".

Note, while the title of the page is misleading, the December CTP of WinFX is available for XP... not sure why there isn't a specific page for WinFX without all the Vista references... oh well.

Uhm, no I won't be singing for a career

The latest MSDN holiday episode is available, while the code and technology is the best to date (IMHO), the singing is probably the worst I've ever heard... ouch.

Large numbers of visuals

From a comment:

"OT: terribly bad form to pull the comments off-topic, but here goes.

I just watched the PRS315 PDC video hoping to get the answer to the blog question listed in the slideshow:

"How do we get large numbers of visuals to perform? If we have 100,000 eleemnts to display in a system how do we make it perform? With an immediate draw API I can omit drawing that is out of view or too small to be visible. Where is there some conditionality in the visual hierarchy?"

But the discussion never got round to that question. :'(

Do you know anyone at Microsoft who could talk/write/blog knowledgeably on the topic and if so, are you prepared to prod them to do so? Alternatively, maybe its already been answered somewhere.

Yours,
Confused Programmer (hoping he doesnt have to re-implement the wheel at the DirectX level, given how suitable the WPF wheel looks, at least on the surface).
"

There are several options on how to achieve this, the two main things you need is to have logic to omit elements that aren't visible (which you mention) and carefully choose what needs interactivity and what doesn't. There are three primary ways to create visuals in Avalon - UIElements, Drawings, and DrawingContext.

UIElements are the shapes, buttons, and other controls you know and love. They support input, eventing, layout, etc. Typically a single UIElement will create more than one visual, and the internals of Avalon has to track bounding boxes, input state, and lots of other goo. You can create a scene with tens of thousands of elements that performs adaquately, but that is really pushing the upper limits based on memory and GPU bandwidth. We are working hard to optimize this, but I would suggest that if you have more than 5K elements, you'll want to start doing something different.

Drawings are a lightweight object model on top of the underlying render data that the rendering engine uses. Think of this as object oriented GDI. Drawings don't have input, etc, they tend to be a lot more lightweight. Drawings can scale to the size of tens of thousands pretty easily, however you are still allocating managed objects for all of these.

DrawingContext is the closest to an immediate mode API that Avalon has. DrawingContext directly manipulates the render data that the engine uses. This avoids the managed object overhead, and you are now just working on a binary stream of data used to render. This can scale quite well to very large numbers.

All of that said, Avalon is a retained mode vector based graphics system. So, creating a very complex scene can cause the system to bog down, especially if you do anything to force software rendering (BitmapEffects like a drop shadow, or complex opacity effects with the OpacityMask, etc).

You as the data provider is in the best position to optimize the visuals that you create. Just as a stupid example, you wouldn't implement Virtual Earth by rendering all the visuals at all depth for the world and then just panning around. Nothing would scale to that level.

I'm not sure your exact scenario, but depending on what you are doing one of the three APIs above should hopefully give you the features, performance, and scalability that you need. The last bit is to write some type of host that performs the render. When I wrote a Virtual Earth host in Avalon, I ended up writing a custom panel that overrode OnRender. I needed a panel because I wanted to support layout of pushpins, but then only the layout new where the map tiles should be placed. It worked pretty well, but of course it violated some of the purist views of what a panel shoudl do... but code wins :)

Good Luck!

In other news...

Hmm... what is this?

Blogging in Windows

I agree with a bunch of stuff that Robert McLaws says about Microsoft being a dinosaur, however I think that the various people blogging in Windows would disagree that Windows doesn't blog. We've released multiple CTPs of WinFX and Vista over the past year, and more to come (soon!). Windows is a big organization, very big (8,000 - 14,000 depending on how you count it!)... Of course I and some other folks think it should be smaller, but that rant can be another post.

Developer Division (which produce Visual Studio) is a much smaller organization, and has been leading in transparency. I've worked in DevDiv for many years, and now in Windows for several years, and the two groups definetly have different cultures. I'm happy to see the Windows group learning from DevDiv's experiments. I'm thrilled that CTPs are becoming a more common thing, that people are blogging more, and that community is becoming something that everyone thinks about.

I agree, we have a long way to go, I'm just not sure I understand your point in your post... Should we post internal milestone planning? Is it that you want to see our VP's blogging about our next release?

3D Framework

Daniel Lehenbauer has the beginings of a 3D Framework over at his blog. I chatted with him yesterday, and I plan on taking a version of this and integrating it into my book. The idea of a full suite of 3D primitives was something that I've always wanted, but didn't make the cut for V1... it will be great to be able to at least deliver this in sample form in the book.

Client Settings

While cleaning up my Applications chapter I came across (again) the client settings API. I remember some of the work on this before I left the Windows Forms team, and it was great to see how the API shaped up. Even better, I ran into some issues and was able to find a bunch of information on Raghavendra's blog about the APIs. This whole internet thing might just work out.

PDC CTP WinFX WPF VS RC compatibility

Just a reminder to everyone - The Visual Studio 2005 RC that was given to PDC attendees and is available for download is *NOT* compatible with the WinFX PDC CTP bits that were handed out... WinFX CTPs are still running on Visual Studio Beta 2. PDC attendees got a copy of these bits in "The Goods", and anyone else can download the Beta from MSDN.

... and for clarification, yes, "WPF" is pronounced "Avalon"... the WPF is silent.

off to PDC

In about 12 minutes my ride is showing up to take me to the airport. On Friday I worked until about midnight on my demo that is part of Jim Allchin's keynote. Last PDC Don & I did the whole "Lap Around Longhorn" thing, and this year we set out to try and out do it... we have a lot more content, but actually a bit less time. It's hard to boil things down to be short enough, but still get the key messages across. In addition, we are having a couple extra people part of the song and dance, which makes everything a bit more "fun"!

This PDC is going to be amazing. I can't wait to get updated bits in their hands, see people's reactions to the new C# and VB features around query, and everything else we are announcing (Day 2 of the PDC will be AWESOME!).

I'm a little frustrated that we weren't able to deliver all the bits that I wanted to, but they will get out as soon as they are ready. All the teams involved with developers (Visual Studio, WinFX, Vista) have really embraced the CTP notion, which means we should be able to get real working bits to the customers sooner.

Sorry for the long delay in posting, but it's been *way* too much fun after coming back from Italy to get everything together for my talk and the keynote demo.

Robbie "Mr. Style"...

Robbie is a program manager on Avalon, and gets the title of "Mr. Style" for two reasons - first, he is the PM owner of all the styles for Avalon controls, second, he has a good sense of style and visual appearance.

Robbie talks about the woes of reverse engineering styles, and then delivers a good solution by posting his simple style ported to Beta 1.

Of course, my favorite post to date was learning what a McGuffin is.

Avalon (er, WPF) Under the Hood

At PDC 05 myself and two other architects from Avalon (Greg Schechter and Jeff Bogdan) are presenting "Under the Hood". Our goal with this talk is to give a overview of how we built Avalon. What the major sub systems are, how they act and interact. My plan right now is to go through the life of an application, from XAML and compilation to displaying pixels on the screen, then following how input gets from the keyboard/mouse to your element in memory. That's the first 30 minutes.

Then we want to do Q&A for 45 minutes. Any question about how Avalon is built, what things do, why we did it that way, what options did we not do, anything!

There is always a fear when you do these Q&A focused sessions that no one asks a question. So, I'd like to poll everyone to get some "feeder" questions. If you are going to the session - what are your questions? If you aren't going to the session - what are your questions? I'll try to answer as many as possible, and write the answers down and post them somewhere on the web (here, MSDN, something).

Thoughts? What do you want to know about the inner workings of Avalon?

Another voice

ChuckJ joins the blogging fray... Chuck is a wickedly smart dude... He spent time working on the XAML spec amoung other things... Subscribed.

What is in a name...

Microsoft generally sucks at naming. I guess it isn't as much as we suck at naming, as we have a styling of naming that is boring, bland, and corporate. Ironwood became the Windows Foundation Classes. Avalon now has become "Windows Presentation Foundation"... I'm not even sure what a "Foundation" is, let alone what a "Presentaiton Foundation" is... are we creating a new form of concrete and rebar? Oh well.

I actually kinda like the new name for Longhorn - "Vista". I heard about it first on my vacation, on CNN. Funny how things work out.

Given the "great" name that Avalon got, I was a bit suprised that we didn't canll Longhorn - "Windows Operation System Foundation 6.0".

 

Monad madness

Monad is alive and kicking! Adam is blogging about all the cool stuff you can do.

I'm frustrated that the Monad folks still don't "get it" from a stand point of distributing a beta, but if you have a passport account you can get a copy of the beta through http://beta.microsoft.com. Use the guest ID of "mshPDC", select "Microsoft Command Shell", select "Survey" in the left column, and 48 hours later you should get access. Why can't they just make it a link?

I've been using Monad as my command shell replacement and it's pretty slick. Having to learn a new command set is challenging, but most of the familiar old commands are available.

One of the most interesting things about Monad is that it is a real dynamic language from Microsoft. Monad's command shell is really just a script interpretter, meaning that you can define variables, use for loops, etc, all from the command window.

Congrats on the latest release folks!

Kramer on the core

We have another blogger in the midst for Avalon - Nick Kramer (rss). Nick is a PM on the Avalon core, his blog is diving into some great low level topics like our threading model.

Avalon/Indigo Beta 1 RC

After you go download Avalon and Indigo Beta 1 RC, you can play with my latest version of AvPad, which includes the scripting support I've been blogging about lately. Because I haven't downloaded the signed version yet, I only included the source, so you'll have to compile yourself.

Of note, there is a complete custom style "custom.xaml" in the AvPad project - so if you are struggling with updating your syntax to the new styling model, you should check it out.

AvPad Source

Practical python

I've added a couple more features, and merged some code with John. So, now I have a PyConsole control that can be used in any application to get a interactive python console. PyExpr, which allows for attributes to be set to python expression (<Button Content="{PyExpr 4+4}" />). And PyScript which I've been showing at length here.

Yesterday I decided to actually write something usefull with this. With about 161 lines total (about 80 python, 80 xaml) I wrote a class browser, complete with filtering! Having interactive scripting (no F5, no refresh, nothing!) is amazingly productive. I wouldn't want to build a big application using this stuff, but for glueing together other components, this is such a slick model.

Probably the neatest python feature used, list filtering:

allprops = [pi for pi in t.GetProperties() if pi.Name.Contains(_filter.Text)]

Also ran into a nasty Avalon layout bug that i'll have to have someone look at on monday. The scrollviewer just seems to not want to cooporate with my layout.

 

Complete source for the class browser.

Python binding

In a comment Rick says "Hey, you do realize that Python has excellent list/tuple/dictionary objects, right? You shouldn't need to make a special ICustomTypeDescriptor to do what you're doing."

I had to enable GetHashCode and SyncRoot on list to get rid of the call to ToObjectArray(). Once i did that, I could then directly bind to python lists... wahoo!

Next, Touples are already exposed as IEnumerables, so they work naturally as a list... but you can't bind to the members. Without changes to the binding infrastructure I think a list is the best we can get.

Finally, I just added ICD to Dict, which enables binding directly to the named items in a dictionary. This is actually pretty nice, and something we should consider adding to data binding directly. It's very slick to be able to bind using keys to the items in a dictionary...

_list.ItemsSource = [
  {'name':'string', 'value':'cool value'},
  {'name':'button', 'value':Button(Content='cooler value')},
  {'name':'textbox', 'value':TextBox(Text='whatever')},
  {'name':'colors', 'value':ListBox(
     ItemsSource=[color for color in dir(Colors)],
     Height=75,
     Width=150)},
]

Notice that i'm also able to bind to list comprehensions and everything! :)

In another comment Drew asks "Do you know if they support IExpando yet? Support would be pretty easy to add I assume and would have some benefits as I discuss here"

It doesn't appear that IronPython supports IExpando. I don't use unmanaged scripting engines really, so I'm not going to try and add it. Binding into Avalon is my focus right now.

And finally Christian says "Off topic: How do you measure the builds? I see on the AvPad screenshot that this is build "0001". Is this really build 1 of this version? Do you always increment when you rebuild in VS?"

I manually increment the build version when I publish a new release. I've been working on 1.2.0.0001 for a while now. I woulnd't mind using auto-increment, i've just been too lazy to do it.

More python

ok... First, shared source just rocks. I spent the last several hours implementing a new feature in IronPython, exposing dynamic properties through ICustomTypeDescriptor... no waiting for months to debate the feature, nothing. If Jim decides that the feature sucks, no worries. If he loves it, I'll send him the source code... super cool.

Second, what this means is that I can now data bind to the properties that I attach in python... combine that with ContentControl, and you suddenly get true cool stuff...

To really appreciate the picture, you have to grok this:

class Item(Object):
  pass

a = Item()
a.name = 'first'
a.value = 'cool value'

b = Item()
b.name = 'second'
b.value = Button(Content='cooler value')

c = Item()
c.name = 'third'
c.value = TextBox(Text='whatever')

_list.ItemsSource = [a, b, c].GetObjectArray()

_list is the ListBox, I have a template (style.visualtree) that simply has two content controls, one bound to "name", the other to "value". I define a new type in python, with *no properties*. I then dynamically assign anything to the objects with the name "name" and "value"... everything else is Avalon + Python goodness... oh yeah!

 

DiveIntoPython

Gossman suggests "DiveIntoPython" for learning the details of Python... I'm a little addicted right now... lambda functions... touples... tasty dynamic language... mmmmmmm...

Inspiration in python

Inspiration from John Gossman, and access to AvPad's sources... as soon as the new CTP is released this code will run inside of AvPad... oh yeah, that's what i'm talking about!

<?Mapping ClrNamespace="System" Assembly="mscorlib" XmlNamespace="Sys" ?>
<?Mapping ClrNamespace="AvPad.Controls" Assembly="AvPad" XmlNamespace="application/avpad" ?>
<Grid
    xmlns:sys="Sys" xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
    xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"
    xmlns:ap="application/avpad"
  >
  <Grid.Resources>
  </Grid.Resources>
  <Button Name="_button" HorizontalAlignment="Center" VerticalAlignment="Center">
      Hello World
  </Button>
<ap:PyScript xml:space="preserve">

def click(sender, e):
  MessageBox.Show('hello')

_button.Click += click
</ap:PyScript>

</Grid>

Ed's defense of Navigation

In response to my post yesterday, Ed fires back with some good points about user model, window management, and familiarity...

"While there are tons of sexy features coming in Avalon, my money is on navigation as the single most important feature. Sure, the MIL, simple 3D, styling, declarative design, great tools, interop, etc, are all cool, but navigation is what Windows client programming is most sorely missing today and will benefit most from in Avalon." [Ed Kaim]

The book - "Programming Avalon"

OK, a progress report on the authoring...

First, I submitted my chapter by chapter schedule for the book. Ten chapters (I wanted 7, but the Overview, Interop, and Base Services pushed me over the limit).

  • Chapter 1: Due 12/15 (yes, this is the last chapter i'll write)
  • Chapter 2: 5/27
  • Chapter 3: 6/13
  • Chapter 4: 10/4
  • Chapter 5: 10/13
  • Chapter 6: 10/25
  • Chapter 7: 11/1
  • Chapter 8: 11/7
  • Chapter 9: 11/17
  • Chapter 10: 12/2

My target for the book is ~350 pages. I'm taking some advice to heart - make the book as short as possible, but no shorter (with appologies to Albert).

I have approximately 25 pages written to date. My goal is to try and do about 20 pages a week. I'll have ~6 weeks off for a long vacation this summer, and ~4 weeks off for the PDC. The goal is to sim-ship the book with the release of Avalon.

I've created a new category on the blog "Programming Avalon" for future posts about the book.

Ready to rock and roll on the book

Alrighty, today I had a conference call meeting with my team at Addison Wesley that will be involved in the writing of my book. I'm still looking at getting together with Don, but for now I'm pushing forward until we work out the details.

By EOD Wednesday I need to have a chapter by chapter schedule for the book. Should be fun.

I'm planning on releasing excerpts from the book up here on my web site, publised in the new "Metro" document format that we announced at WinHEC. Should be a lot of fun.

Tonight I need to get going on the Preface, as that is my first deliverable to the publisher. Tomorrow night I'll work on my schedule for the rest of the chapters. Should be a fun summer.

Quartz, a new codename for me

As I learned from internal and external folks in comments about my previous post, Quartz is also the name for the DirectShow runtime in Windows. Avalon doesn't directly use DirectShow. When playing video, i've been told, the DirectShow runtime will be loaded by the media subsystem. However, for rendering of all other content (2D, 3D, animations, etc.) the dependency is only on Direct3D.

Always good to be reminded of how little you know :)

MIL Information

Videoguy asks in a comment: "Is there yet more specific information about MIL around? I mean it looks like Avalon uses MIL to interact with the media elements. Is MIL using Quartz (through DX?) on both XP and Longhorn or something else? Can you elaborate on why MIL lives apparently on a native DLL?

If there's some presentation coming or that already answers these questions I'll gladly take a pointer to such too.
"

Quartz is a Mac OS/X feature, so I think we can rule that out on Windows ;-)

As for the rest, there are two definitions of "MIL" for Avalon. MIL standads for the "Media Integration Layer", and typically refers to either the set of technology that our MIL team produces, or the set of technology that resides in MILCORE.DLL.

MILCORE.DLL is the unmanaged composition engine that Avalon uses for rendering. It is a layer above Direct3D, giving us basic 2D, 3D, Animation, and Composition services (probably a few others i'm forgetting to mention also). The composition engine is unmanaged primarily for interop/performance reasons. The composition engine spends most of it's time talking to Direct3D. In addition, there are multiple customers of the composition engine, including some that can't take a managed code dependency right now.

There is also another unmanaged DLL, WindowsCodecs.dll, which houses all the unmanaged implementation of our imaging codecs - BMP, JPG, etc.

The rest of the core that the MIL team produces lives in PresentationCore.DLL. This is the low level APIs of Avalon, dealing with the base Visual system (2D, 3D, etc.) that is a combination of wrappers ontop of MILCORE.DLL, and a set of value add features written in managed code. Also in the Core is the base implementation for UIElement and ContentElement - the roots our our display element and typographic hierarchies.

Avalon on Channel 9

Pablo, Arik, and Karsten do the dance on Channel 9...

Dave Shea on Avalon and XAML

Dave saw a presentation on Avalon at Flash In The Can, and had some interesting take aways...

On 3D: "I’m somewhat unclear how detailed the native 3D rendering support is. There was a demo of multiple video sources being mapped to rotating spheres, so there’s at least a few basic shapes and textures. My confusion is partially the result of the ‘special guests’ pulled on stage — a software company that created a 3D -> Flash convertor, which it had adapted for Avalon. Given Flash’s lack of native 3D object support, hence the need for this tool, I’m left wondering what that means for Avalon’s 3D support."

The big difference here is that Zam3D for Avalon allows the full 3D model to be brought into Avalon. You can rotate at runtime, zoom around the model, change lighting, etc. Their Flash based product flatens the 3D to a fixed series of 2D vectors, which gives you a fixed movie, instead of an environment.

On XAML: "The code itself looks like (well-formed) tag soup from 1997. Whereas the web has seen a shift from presentational markup (in the form of tables, embedded attributes like bgcolor, and the dreaded font tag) to structural markup with a separated presentation layer (CSS), XAML is purely a presentational language. I couldn’t see evidence of attention toward semantics, and all the presentational attributes are embedded right in the markup. Januszewski referenced ‘a CSS-like syntax’, but there’s nothing CSS-like about it. It’s ugly presentational HTML all over again. A sample snippet:"

Ah, here is one thing that I think just didn't show through on the demo. Avalon uses a very powerful styling system to allow exactly the type of semantics that Dave talks about. You can have simple markup ("<Button />") and then elsewhere declare exactly what the button looks like (using "<Style.VisualTree>"). I think the biggest difference with Avalon's model is that it is extensible. CSS works great for the fixed set of ~200 attributes that they define, and for their fixed set of elements (I understand that CSS can be applied to arbitrary XML, however the output is limited to the browser HTML render).

This is a platform, so all of this works seamlessly with accessibility, globalization, etc.

On web integration: "I’d be a whole lot more comfortable with XAML if it were strictly meant as a Windows OS rendering language. Proprietary markup on a proprietary platform is nothing to get worked up over. But the obvious web cross-over leads me to hope we’re not going to see a whole new generation of browser/OS-specific web apps. I wonder if Microsoft might be hoping for something different."

Avalon is a Windows platform technology. XAML is a language for binding CLR objects into markup. Avalon elements in XAML is a Windows application markup. The ability to seamlessly deploy and integrate Avalon based applications into the browser is our attempt to bridge the worlds of the web and Windows. Today application authors are forced to choose between rich client applications and familiar browser activation, hosting, and ui models. With Avalon we are trying to make it so that people that want to build rich client applications can leverage the user's familiarity with the browser.

On devices: "What will this code do on a PocketPC or PalmOS cell phone?"

This is a fabulous question, and I can say right now, I don't know. There is some hope that we could build a PocketPC version of Avalon (much in the same way there is a PocketPC version of Win32/User32/GDI/WinForms/etc.). PalmOS is probably not doable, because it isn't based on Windows (Avalon is pretty closely tied to DirectX, which is available for PocketPC but not, to my knowledge, PalmOS - there are other OS dependencies there as well, this is just one example).

Building client software for Phones/PDAs/TVs/etc have very different input and usage patterns. This is an area that I'm really interested in - how much can you really reuse the UI? I'm all for saving the business objects, which I can do today using .NET Compact Framework, but when it comes to the UI, I'm not convinced that any level of styling will make my desktop application "just work" on my cell phone.

Dave isn't universally down on Avalon... there are some great quotes in there:

On Quartz and Avalon: "Without getting too carried away with the specifics though, what seems to be the main difference between Quartz and Avalon is the openness and flexibility."

Anyway, Dave, keep the feedback coming.

If anyone out there knows Dave, I'd love to chat with him via phone, email, or in person.

Avalon designers...

I've been meaning to blog about Zam 3D ever since I saw them at a recent customer event on campus... Michael Swanson reminded me that they released they CTP build... Super cool tool...

When people ask why Xaml was based on XML, this is a great response!

Fil Fortes, "Master of Text", starts posting again

Fil is posting again, about text, of course... Fil recently won an award for the best dressed Avalon team member, you'll have to ask him to figure out why...

Avalon and Indigo for All!

The Avalon and Indigo March CTP is now available for anyone to download! Get it while it's hot!

Nathan blogging

Nathan showed me the empty site for www.designerslove.net, but at the time he didn't have content... wahoo!, he is posting!

Uhm... except I can't his RSS feed (only atom), and I can't find the permalinks on his site... and there isn't any comments... ouch.

Either way, Nathan is the man behind all the cool visuals we use in Avalon demos. His 3D button is freakin' amazing!

Try this...

Rev 8 of AvPad... I spent a couple hours this morning rebuilding my dev box with (hopefully) the right signed bits, so you should be able to run it now... Sources are still available...

AvPad... my bad

Turns out that my March CTP machine had a slightly different build of the CTP than what we distributed (basically I had an RC on my machine). So, trying to "run" AvPad won't work for anyone. You can download the sources and recompile and it should work. I'm working on getting a copy of the official build we released, at which point I can safely repost the build.

As a side note, it seems pretty screwed up that our binding story to assemblies is so strong that a dot-release on an RC causes everything to fail. I hope I can track down someone on the loader team to explain to me why this should work this way.

AvPad fixes

I removed the dependency from AvPad to PresentationFramework.Luna... I used this reference when building the new style for all my controls, but it wasn't actually needed to run. According to the comments, it sounds like this was biting some people when running...

As a side note, I set the update frequency to be 3 days, so if you really want to pickup the new fix immediately, you will need to click the run link again.

Run, or download the source and binaries.

March CTP != VS 2005 Beta 2

Sorry Kevin, but alas the Avalon/Indigo March CTP will not be compatible with Visual Studio 2005 Beta 2 when it is released...

Trusted sites and March CTP

Ah, a key thing I forgot to mention was that ClickOnce in the March CTP requires the site to be in the trusted sites list to work (or Authenticode sign the app)... this will be corrected in a future release, but for now you can either add http://blog.simplegeek.com to your trusted sites list, or down the application and run it locally.

XamlPad clone... "AvPad"

OK, with the new March CTP builds (get it today for MSDN, soon for everyone!), I did some major overhauls of "XP", my XamlPad clone. Now it's called AvPad... Some new features:

  1. Ships with a complete custom style for all Avalon controls
  2. New "radial" menus animate in from the corner (ok, this is kinda a hacked in feature <G>)
  3. Better background parsing (waits to parse based upon the duration of time it takes to parse)
  4. Child window manager implementation
  5. Visual tree viewer

Note Because this requires the March CTP, this will not auto-install if you have the previous version of "xp" installed. You must choose "run" below to get the new ClickOnce subscription...

Run

Source and Binaries

WinFX: Avalon + Indigo March CTP

Oh yes Sam, we released again! For right now it's only available to MSDN subscribers...

This new CTP marks the first combined Avalon and Indigo release since PDC 2003. It is awesome to be able to use recent bits from both stacks together.

CTPs are relatively tough things - we release effectively "daily" builds from the labs and publish them. Expect a non-trivial number of blocking bugs and good set of release notes. That disclaimer said, this is by far the best release of Avalon we have had.

Tomorrow morning I'll post the new version of AvPad (my renamed version of XamlPad), complete with a new style for all controls, custom layouts, custom controls, background parsing, all sorts of fun!

TheServerSide.NET interview

Late last year I was interviewed by the folks over at TheServerSide... it just went live... wahoo!

Custom animation types in Avalon

IanG animates FontSize, showing the flexibility of the animation system in Avalon. Very cool!

Kevin Moore (Avalon PM) having a geek dinner

Kevin Moore is a PM on the Avalon team, and is looking to get together with a few folks in the small town of London. Any takers?

The Book

I've written a proposal to a major publishing house. I've talked with several people that have written books. I've considered co-authoring with people. At this point a lot is up in the air (I still haven't gotten an offer from the publishing house), but I think things are moving forward. I've started writing and I have about 12 pages of real material. I'm going to try to set some rules - at least 1 page a day, at least 25 pages a week. Both are aggressive goals, from what I hear.

Probably the most terrifying thing - breaking changes. I know how many changes we are making right now, and the idea of processing breaking changes through a 500+ page book scares the begeezus out of me...

Thinking about writing a book...

I'm seriously considering writing a book on Avalon. I've gotten some pretty sage advice from a couple of people. I have a story I want to tell about Avalon, what we built, how to use it, and why we made some of our design decisions. I really wish I had comments up and running, what I really want is to hear what you want to read about...

Response to MSDN TV show

I got a question in the comments of my latest MSDN TV show appearance with a response email address... I figure I'll post a blog response and email the person...

Q: "No definition of what Avalon is: A layout designer? A windowing system to replace Windows API? Absence of contrast to existing methodology that shows benefit. Contrast to Qt."

A: We have talked about Avalon in other forums, so in that particular TV episode we didn't cover the basics. Avalon is a new presentation layer for Windows. It isn't neccessarily a replacement for the Windows API, but more an eventual replacement for specific technologies (User32, GDI, etc.). The roadmap of technologies WinForms, User32 transitioning to Avalon is best answered over on John Montogomery's blog.

Avalon is a rich, integrated, productive UI platform. If we compare/contrast that to other platforms, we see a lot of rich-but-not-integrated libraries (HTML, Flash, etc.). These libraries do a couple things great (text, animation, etc.) but don't really offer a comprehensive integrated platform. We have some productive libraries (VB6, etc.) that offer great developer productivity features, but don't go far enough in richness. The design goal of Avalon was to try to achieve all three:

  • Rich: High quality text and graphics with built in animation.
  • Integrated: Best of Win32, best of the Web, integrating UI, Documents, and Media
  • Productivity: Built from the ground up for developers and designers

We could drill into each topic for quite a while, but for starters lets talk about one of the points - Integrated.

Avalon strives to integrate Windows and Web concepts. We have native support for navigation, custom controls, dialogs, typography, dynamic layout, localization, shell integration, and the preverbial "more". Traditionally developers had to choose between a great client application or something that supported navigation. When you chose navigation you were also forced to implement using JScript/HTML/server programming and running in the browser. In Avalon you can build a navigation application and then decide if you want it to run inside of the browser or externally. Browser hosting is just a bit in the project file. It is simple concepts like this - separating the navigation decision from the rest, that allows this rich integration of windows and web concepts.

I haven't used QT, so I can't really compare. sorry.

Thanks for the question!

Kam's blogging

Kam VedBrat is blogging... Kam is a new (but not to Microsoft) member on the Avalon team , he specializes in user experience (design, etc) and is working on all sorts of cool stuff.

Sells and Solitaire

Very cool solitaire program that Sells wrote... The perf is pretty bad, clicking a card has a delay, etc... we should get this app into our perf lab and figure out what the issues are (besides just the loading of the resources 52 times)... I love the graphic - the hand drawn card faces look AWESOME!

Couple "bugs":

  1. Card stack "auto shows" when you pull from it (for example, you take an initial ace from the lower section)... this could be called a feature, but because the "real" sol.exe makes you click, I kept accidentally doing this. Compatibility is a feature :)
  2. Cards have a wierd green "box" around them. We are fully composited, it should be transparent around the corners.

And a feature request - change the opacity while dragging to make the cards semi-transparent... that would be cool. Oh, and make every game winnable. Oh, and add cool 3D spinning stuff... and... uhm, I'll go back to work now :(

Preparing for a customer visit

I'm going to a customer visit next week, and the material is the begining of what I hope to be some of the central story that we are going to be telling at the PDC. I'm really pushing hard for focus on content and the story, and not on power point presentations. Of course there are some good uses of powerpoint, but far too often people get wrapped up in the slides...

I don't have my notes in front of me, but I believe for a 4 hour presentation, this is the outline:

  1. Vision
  2. Overview & Lap around Avalon
  3. Application Model
    1. Navigation
    2. Application Styles
    3. Deployment
  4. Building UI
    1. Layout
    2. Controls
    3. Vector Graphics
    4. Resources & Styling
    5. Data Binding

Almost all coding, with myself and Rob... should be a lot of fun!

Shameless self-plug

The latest in the "Inside Avalon" series just got published on MSDN... this time I cover Properties, Commands, and Events... oh my!

[fixed link]

Avalon chess game

Chess game for Avalon... looks pretty good so far... can't wait to see the 3D version he is working on! :-)

Co-opting a name... what is XAML?

I have to respectfully disagree with Marc Clifton's article on Code Project. There is one definition of what "XAML" is - it is a set of technology that Microsoft is producing. Whether or not we license it to other vendors, people attempt to clone it, or what, there is still only one thing that is XAML. I feel somewhat passionately as I, and other people I work with, invented the thing and are still working on the final definition of it.

If you want to claim that Xamlon, MyXaml, and other attempts at XAML clones are in fact XAML, that is incorrect. They are attempts to clone XAML.

If you article was entitled "what are options in declarative UI definition" and you listed "XAML and Avalon", "Xamlon and Windows Forms/VG", "Lazlo", etc., I would have no complaint. MyXAML is not XAML, Marc even says this himself. Lazlo is clearly not XAML. I don't have anything specifically against MyXAML, Xamlon, Lazlo, Flex, XUL, or any other declarative UI programming models - but I would no sooner claim that XAML was Flex as I would expect Macromedia to claim that Flex was XAML.

Pong

I've been waiting for the killer app for Avalon and WinFX... Pong is here! Joe has a pretty interesting blog, including a very cool pi calculation algorthym using streams (although I think enumerators would work even better here?)

I second that... IanG, could you port?

Daniel hits the nail on the head... Ian, you should port your mesh converter to the CTP drop! :)

XAML inside Visual Studio

I love it when folks in the community do a better job than us! <G>

Gaston Milano wrote his own XAML viewer that is integrated into Visual Studio. [Link From RRelyea]

Rock On!!

Yet another release of XamlPad

After integrating Daniel's 3D demo, I realized what I really wanted was on out of band way of post "demos" into XamlPad... so, XamlPad is now a connected client... There is a "Demos" menu that is populated from a web service and downloads the demo you chooses on demand. Of course, the next release (or soon there after) will cache the demos locally, but for now I can start publishing demos out of band...

Also, I fixed some parsing issues (parse in idle instead of key press), and some other minor fixes.

Again, once you install from the ClickOnce file, you don't need to force the upgrade, it will trickle down somewhere in a day or so... (or, for those of you more impatient, just run the link again <G>)

Nick Cody's visual debugging...

Nick Cody over at Primordial Ooze has a visual step by step of trying to get XamlPad working... very useful for anyone running into problems... He is running the Royale theme, so you might have to copy the file to a different name...

3D... this is too cool!

Daniel Lehenbauer ported his Amiga inspired demo to the new CTP build... not to be outdone, I shaved off enough of the demo so I can run it straight in XamlPad... XamlPad is now much heavier (up to ~200Kb), but there is a snippet that is Daniel's bouncing ball (lights and reflection removed to make it not require any code)...

I added a new menu to the XP menu - "Reset Snippets", which will let you get access to the new snippet.

Note For some reason, if the text area has focus the animation is really choppy of the ball. The work around (super hacky!) is to click the splitter bar (giving it focus), then the animation seems much better. Hopefully someone at work tomorrow can investigate...

Quick disections of Windows Forms in XAML

Just to make sure everyone understands the last post I did, I thought I'd simplify a bit and explain what everything is... First, a warning: when working on this post I ran into a lot of cases where XamlPad would hang or crash. Not sure the cause, I'll work on debugging this tomorrow. For now, I would suggest editing in notepad and pasting into XamlPad. My guess is that there is something about tearing down and recreating the Windows Forms controls that is causing a hang...

<?Mapping
  XmlNamespace="windowsforms"
  ClrNamespace="System.Windows.Forms"
  Assembly="System.Windows.Forms" ?>
<?Mapping
  XmlNamespace="windowsformsintegration"
  ClrNamespace="System.Windows.Forms.Integration"
  Assembly="WindowsFormsIntegration" ?>

<Grid
xmlns="http://schemas.microsoft.com/2003/xaml"
xmlns:x="Definition" xmlns:wf="windowsforms"
xmlns:wfi="windowsformsintegration">

<wfi:WindowsFormsHost>
   <wf:Button Text="Hello From Windows Forms" />
</wfi:WindowsFormsHost>

</Grid>

Anyway, the first two tags are "mapping PIs". These will be going away in a future rev of the XAML spec, but for now they are the way to import a namespace/assembly into an XML namespace. We need to import System.Windows.Forms and (because XamlPad is written in Avalon) the System.Windows.Forms.Integration namespace. SWF.Integration is there when you need to host Avalon in Windows Forms or vice versa.

The root tag is a Grid, really it could be about any Avalon element. Then we have the WindowsFormsHost, which is an Avalon element that knows how to host a Windows Forms control. Finally we have the Windows Forms Button tag, with it's text set. Really the only whacky part is the mapping PIs.

Windows Forms and XAML

Oh yes, it works!

Avalon, XAML, and Windows Forms

Using any rev of XamlPad, you can paste the following XAML into the window and see Avalon and Windows Forms components interoperability. Wahoo! I added a new snippet to XamlPad rev 8 that is this sample. If you have a current version of XamlPad, just delete the snippets.xml file from your My Documents\XamlPad directory and XamlPad will automatically recreate the file. I should probably add a feature to recreate this file. Check this out:

<?Mapping XmlNamespace="windowsforms" ClrNamespace="System.Windows.Forms" Assembly="System.Windows.Forms" ?>
<?Mapping XmlNamespace="windowsformsintegration" ClrNamespace="System.Windows.Forms.Integration" Assembly="WindowsFormsIntegration" ?>
<Grid xmlns="http://schemas.microsoft.com/2003/xaml" xmlns:x="Definition"
  xmlns:wf="windowsforms"
  xmlns:wfi="windowsformsintegration">

<Grid>
 <Grid.ColumnDefinitions>
  <ColumnDefinition Width="*" />
  <ColumnDefinition Width="*" />
 </Grid.ColumnDefinitions>
 <Grid.RowDefinitions>
  <RowDefinition Height="*" />
  <RowDefinition Height="*" />
 </Grid.RowDefinitions>
  <Button Grid.Row="1">Hello From Avalon</Button>
  <Canvas Grid.Column="1" >
  <Ellipse Width="50" Height="50">
   <Canvas.Top><LengthAnimation From="0" To="100" Duration="8" AutoReverse="True" RepeatDuration="Indefinite" /></Canvas.Top>
   <Canvas.Left><LengthAnimation From="0" To="200" Duration="2" AutoReverse="True" RepeatDuration="Indefinite" /></Canvas.Left>
   <Ellipse.Fill>
<LinearGradientBrush><LinearGradientBrush.GradientStops><GradientStop Offset="0" Color="#FFFFFFFF" /><GradientStop Offset=".33" Color="#FFFF0000" /><GradientStop Offset=".66" Color="#FF00FF00" /><GradientStop Offset="1" Color="#FF0000FF" /></LinearGradientBrush.GradientStops></LinearGradientBrush>
   </Ellipse.Fill>
  </Ellipse>
 </Canvas>
  <wfi:WindowsFormsHost Grid.Row="1" Grid.Column="1">
   <wf:Button Text="Hello From Windows Forms" />
  </wfi:WindowsFormsHost>
  <wfi:WindowsFormsHost>
   <wf:TreeView>
    <wf:TreeView.Nodes>
      <wf:TreeNode Text="Hello">
        <wf:TreeNode.Nodes>
          <wf:TreeNode Text="Hello" />
          <wf:TreeNode Text="Hello" />
          <wf:TreeNode Text="Hello" />
          <wf:TreeNode Text="Hello" />
        </wf:TreeNode.Nodes>
      </wf:TreeNode>
      <wf:TreeNode Text="Hello" />
      <wf:TreeNode Text="Hello" />
      <wf:TreeNode Text="Hello" />
      <wf:TreeNode Text="Hello" />
    </wf:TreeView.Nodes>
    
   </wf:TreeView>
  </wfi:WindowsFormsHost>
</Grid>

</Grid>

Rob fixes CTP for Express skus...

Rob posted the steps for fixing up the WinFX SDK to work with C# Express... THANKS!!! I think there is a slight typo... on my machine the double-double quoting of the directories got my command window angry... here is what I did:

set MyVisualStudioLocation="%programfiles%\Microsoft Visual Studio 8"
copy "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\CSharp\Avalon\1033\*.zip" %MyVisualStudioLocation%\Common7\IDE\VCSExpress\ProjectTemplates\1033
copy "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\*.zip %MyVisualStudioLocation%\Common7\IDE\VCSExpress\ItemTemplates\1033
copy "%programfiles%\microsoft visual studio 8\xml\schemas\avalonFall2004CTP.xsd" %MyVisualStudioLocation%\xml\schemas\
copy "%programfiles%\microsoft visual studio 8\xml\schemas\xamlFall2004CTP.xsd" %MyVisualStudioLocation%\xml\schemas\
%MyVisualStudioLocation%\Common7\IDE\VCSExpress.exe /setup

Basically, I had to remove the quotes from around the target of the copy commands.

Another XamlPad release...

I've released about 7 builds totaly of my XamlPad Clone now (just pushed one up)... In the latest release (v1.0.0.7) I moved the location where files went by default (to My Documents\XamlPad) to allow you to run as admin, and to find the files since ClickOnce puts the application in a random directory. The Snippets file is there also, so you can add new snippets - you'll have to restart the app once you update the snippets XML.

Some discoveries:

  • Our default manifest generator kinda sucks - I have to hand edit it each time to update the company and application name.
  • Internally we had several problems with left over crud from random installed builds breaking deployment... hopefully that shouldn't be a problem for many of you folks out there.
  • I have no idea how many people are installing or using this thing. I think I'm going to add an OPTIONAL ability to notify me when you install it. We'd like to track (at least internally) how many people fine the application useful. I'll probably also put in a little feedback form so people can complain about problems and suggest features since I don't have comments on my blog.

 

XamlPad updates

I'm releasing drops frequently for my XamlPad clone, and will continue to do so... ClickOnce deployment makes this pretty simple. New features I added:

  • Simple refactoring - specifcally "surround with" for a couple tags
  • Snippet support - added a couple common XAML fragments
  • Formatting - run the XAML through XmlTextWriter's formatting engine
  • Editting arbitrary files - pass a xaml file in on the command line and it will edit that file instead of the default file

I won't be releasing source for a bit, I'm going to play around with binary deployment for a while. A lot of these features are super hacky right now, and I'd like to move to a more data driven model before I release the source (also it's a bit of a hassle to package up the source and everything else... anyone know of a MSBuild extension for including the source in a package?).

Anyway, if you install via the .deploy that I've linked to, these updates will appear automatically sometime between 1 hour and 1 day after I release the build. You can manually force a refresh by clicking on the link again.

Good to see that Ryan has seen the light...

It wasn't too long ago that Ryan Dawson thought the decision to move to XP was wrong... now he seems happy...

This just hurts my eyes...

This just jurts my eyes... :)

XamlPad Clone... live!

Server problems resolved, you can now run my XamlPad Clone directly... This application does require full trust on your local machine (hence the prompt when you install). The cool part is that it will automatically update when I release new versions, no action is required on your part! Wahoo!

Avalon demo application

I really want to publish this application as a auto-deployed application using ClickOnce technology, however I need to get my friendly site administrator to make a few tweaks to the IIS config... anyway, for the time being you can download the ZIP file (including source) for a little test application for Avalon.

The application is simple, you type XAML in the bottom pane and it gets parsed and rendered in the top. If you type code in error, the error is displayed at the very bottom. This is a clone of an internal application "XamlPad" that some folks wrote... I happened to be without the app on a flight to WinDev last month, so I wrote this clone... Have fun!

XP binaries and source.

[Added Link]

Office welcome to Avalon CTP...

Arik Cohen (on the Avalon team) and a collection of other folks worked on an official overview of the Avalon CTP build on MSDN...

CNET on Avalon release

CNET picked up the story about the Avalon release today...

Avalon CTP released!!!

Today we released a new build of Avalon to the world (well, anyone subscribing to MSDN)... This build of Avalon runs on Windows XP (and Windows Server 2K3, but not the PDC or WinHEC Longhorn builds)... which is pretty cool. Last night I tried to get C# Express and everything installed so I'd have a cool application available today, but it looks like that didn't happen.

I'll be blogging and writing code on this build for the next couple months (I'm taking most of December off from work, and like the geek I am I intend to write some code!)...

A couple points:

  1. This is a "Technology Preview"... translation - rough bits. While I'm willing to install this on my home machine, I don't recommend you put this on your primary development machine. It requires installing a beta build of .NET, etc.
  2. You also need a pretty beefy machine to run the bits.
  3. This build will run on Windows XP
  4. This build will not run on PDC or WinHEC Longhorn builds
  5. This is not the final API set, XAML spec, or anything else - this is a "Technology Preview"

I'm super excited by this. Nothing gets me more jazzed than getting bits into customer's hands. Download the build, install it, and give us feedback. You can send feedback through official channels (forums, newsgroups, even your own personal blog!), or you can always just send me mail at: ChrisAn (at) Microsoft (dot) com.

Thanks Aaron...

Aaron gave me a great compliment on his wrapup of Win-Dev... "whose keynote I thoroughly enjoyed - it was the best motivation for rich client applications that I've heard to date"...

Thanks, and congrats on sponsoring a great conference!

Brian Pepin's view on WinFX downlevel

Brian Pepin (architect on WinForms) gives us his opinion on WinFX, Avalon, and WinForms... "People buy Windows because of the apps they can run on Windows. Developers write apps for Windows because it is the most pervasive platform so they get the broadest reach. Producing a brand-new API and only exposing it on a version of Windows that no one has does not encourage developers to spend valuable time writing apps for it, especially if they can write to an existing API and support both the old and new operating systems."

Security, Complexities, and Standards

Thanks for the response Miguel... I'm still trying to digest the Slashdot thread also (I'll respond on Slashdot for that thread... )...

Before I start, I'm not taking any of this personally - I really enjoy debate, regardless of the opinions. As far as I'm concerned, bring it on! More Feedback == Better.

Security

The low-tech (aka phishing, aka con artist) attacks are being worked on. The social engineering and human behavior/interaction research is happening, it's just not on my team.

As for the "weakest link" characterization of ClickOnce, I think you are confusing some things.

ClickOnce is a deployment technology that improves upon the base technology introduced in .NET 1.0 for downloading and loading code. ClickOnce supports a subscription and application manifest. A principle advantage to the approach is that a customer can establish a subscription to an application and get automatic updates. In addition, the application manifest creates a complete descriptions of the parts of the application - enabling both validation and download/install/uninstall to be implemented by the system.

Next in the stack is CAS - Code Access Security. This is the security system built into the CLR. This technology has been in place since .NET 1.0, and we are continuing to iterate on it. In addition in Whidbey (the version of the CLR that we are talking about here) has a new level of application level security that can "lock back" the permissions of the loaded assemblies to that of the application, further limiting attack vectors.

In the middle of this is the TrustManager. This is a piece of code that provides a user with a single consistent prompt to determine what they want an application to be allowed to do. For example the application might request higher permissions or local installation. The goal here is to remove the half dozen security dialogs that users get prompted with today, and messy installation wizards, with a consistent user experience, giving them complete information.

All of this technology together, gives us the user experience that is (as you put it) one of the fundamental reasons for Avalon to exist. A perfect (or much more secure) computer would be one that you never plug into any network and have no software installed. You wristwatch is pretty secure is my guess.

We are doing usability studies on all of this, to validate that this is going to improve the situation... I'll keep you posted.

Complexity

I've used a handfull of GUI libraries; VB6, IE, WFC, AWT, Swing (limited exposure), KDE/QT (very limited exposure), and Cocco (limited exposure). Cocco was amazingly complex in my usage, the library felt like MVC on steroids with a pretty cool UI designer. KDE/QT felt a lot like WFC in C++, fairly straight forward. Swing, was, well, swing. MVC everywhere, powerfull, but very complex. I found that at JavaOne most of the Swing sessions started with a 15 minute talk on how you really can make Swing fast if you just understand MVC more. I think that the recent versions of Swing are much improved on this, my data is a little dated here. AWT was simple, but I felt that the event adapter model and peer model didn't lend itself to good usability, toolability, or performance. Anyway, I could go on... I'll try to take a look at Tk and XView, if they offer better simplicity, it would be great to learn from them.

The point about abstracting implementation from API is very interesting. The COM model has a very clear abstract, but removes the ability to deal with implementation inheritance. The AWT model of peers supported inheritance, but the real meat of what you wanted to deal with was locked away in the peer. We really wanted to embrace the "component framework" model that is present in ASP.NET and Windows Forms (yes, I know they have a peer model because of the HWND, but the WndProc is directly accessible, etc.)... the idea was to provide component developers full access to the implementation and not special case any Microsoft code as much as possible. The idea being, anyone should be able to implement "Button" and do all the same features we did, with no penalties.

This does come at the cost of more public exposure, but we hoped it would be worth it.

I know that Button is too trivial of an example to really talk about, so lets talk about lists, or more specifically ListBox. In most programming models that I've used the ListBox has a data model of providing strings - this is the Win32/AWT way (I think Cocco also?). Windows Forms added support for "object", but basically you had to .ToString() the thing to get it to display... unless you implement your own custom rendering. In all the systems I've seen the custom rendering is implemented in a completely different programming model - paint code in most systems.

Avalon has a simple "scalable" model. When I say scalable I mean to imply that the API starts simple but can scale up to support complex scenarios without requiring a massive leap in understanding - pay for play in complexity.

<ListBox>
    <string>Hello</string>
    <Image Source="http://..." />
    <Button>Hello</Button>
</ListBox>

You then can get into styles to manipulate all of this:

<Style>
    <ListItem />
    <Style.VisualTree>
        ....
        <Rectangle RadiusX="5" RadiusY="5" />
        ...
    </Style.VisualTree>
</Style>

The key thing is that I never had to switch programming models. Yes, if you try to digest everything at once (styling, binding, commanding, visual trees, etc.) then the system is complex - but the goal was scalability - Make simple things simple, and hard things possible.

Standards

First, an old post from Joe Beda about SVG and XAML.

Second, dismissing the CSS debate isn't really fair. A critical part of our design is unification. We didn't want one markup model for vector graphics, one for styling, one for 3D, one for data, etc. Another part of the unification was "Markup == OM", that is, we didn't want a separate markup programming model from code. HTML is this way, the markup and the code have a loose relationship. If we ignore the unification debate, I can understand how it seems simple to say "you should have used SVG".

Avalon is a developer platform. We want to enable an entirely new breed of applications that span UI, graphics, and media. Integration of typography with imaging with video with controls with styling is a core part of our value proposition. We aren't trying to create a new 3D system or animation system, we are creating a new developer platform.