WPF (RSS)

Windows Presentation Foundation

ZamDes inaugural meeting

As the title (see, that big header-ish thing up there...I'd point but I can't) implies I attended the first meeting of the ZamDes user group in Wellington tonight.

Kudos (even though I hate that word) to Nas and Isha for putting on a very good presentation.

I think this is going to be an excellent way of sharing information and tips and stuff (I've been awake for a whole day so I can't think of more intelligent words than "stuff". But it's a perfectly good word anyway). I'm looking forward to seeing how the web site develops.

And I enjoyed my lollipop.

Visual Studio 2008 Beta 2 is on MSDN

Just thought you might like to know.

Expression Web and Blend to be included in MSDN Premium subscription

Excellent news this morning from Somasegar.

Thanks to the Microsoft Expression blog for the heads up.

Now I just have to bite my nails for a while hoping Expression Blend is released before my MSDN subscription expires...

The WPF/E CTP is finally available

(and the site is up for real this time).

 

Go here for the details.

There's also an interview with Joe Stegman on Channel 9 here.

Now I'll step out of the way while the multitudes rush to make vitriolic if poorly-reasoned Flash comparisons.

 

Personally, I think this is cool (despite the JavaScript).

Moving from .NET 3.0 Beta 2 to RC1

I finally got around to this yesterday (at least on my work tablet - my home PC will have to wait until I have some more bandwidth available so I can download the Office 2007 Beta 2 Refresh...the joy of monthly caps. I've completely given up on keeping the Windows SDK up to date for now - the version I'm using shoud be sitting in a rocking chair surrounded by photos of its grandchildren).

Yes I know there have been CTPs (I lost track of how many) between Beta 2 and RC1, but I've been suffering from CTP exhaustion (and the aforementioned bandwidth caps are also a bit off-putting).

As I mentioned in an earlier post I've been working on a WPF client for  searching Amazon.com...partly because Amazon provide some of the few truly useful public web services, and partly because this was close to a real-world programming problem that would hopefully enable me to learn how to do something useful with WPF (as opposed to Yet Another RSS Reader For Only One Feed That Never Updates).

But anyway, I wanted to talk about my upgade experience.
I had known in advance of a few breaking changes and incorporated them into my code, and I obviously expected to have to update my references.
I still got caught by a couple of things however.

Initially I was getting what appeared to be bizarre interop errors, accompanied by an "Access is denied" exception, which had me taken aback. This was fixed by - wait for it - adding a Title attribute to my window. Just goes to show.

Then I noticed that my default TextBox was no longer receiving focus on startup...that had me puzzled for a while, because the expression I use
( FocusManager.FocusedElement="{Binding ElementName=searchBox}" ) agreed with the syntax in recent examples. I checked that my TextBox was indeed called searchBox (we can debate whether it should be, but frankly Scarlet I don't give a damn). It was. Then I realised that unlike everybody else, I had my FocusManager settings thingy bit defined at the Window level, a couple of levels above searchBox. This worked fine in Beta 2, but clearly things are now different. I move it to the containing element of searchBox and it worked like a charm. I don't remember seeing that listed anywhere as a breaking change, but I might have just missed it while ignoring updates, or it could simply be that nobody mentioned it because they didn't expect anybody to do anything stupid like defining it at the top level anyway.

So now it works fine, which is nice.
It's great to finally be able to try out WPF in its feature-and-syntax final form. The possibilities are many and nifty.

Update: Yes I know that .NET 3.0 Beta 2 is arguably an anachronism, since it was still called WinFX back then. But it's nowhere near as bad as when I was studying 6th form history and forgot when the Austrian Empire became the Austro-Hungarian Empire. So there.

Atlas at last

Today I finally managed to download a non-corrupted version of the April Atlas CTP installer, and I now have everything up and running (having installed the Control Toolkit as well, naturally). I'm particularly looking forward to coming to grips with the CascadingDropDownList extender, since that's a very common requirement. I came across a very informative blog post by Shawn Burke that will be a big help in that regard.

At the other end of the rich client scale (sort of, in some way, whatever), I've been working on a WPF client for the Amazon web services, just as a way of making myself learn more about WPF by using it for a more or less real application. It's been very handy that way - one thing I learned for instance was how to use the Dispatcher to enforce the one request per IP address per second restriction, and at least one approach to hot-swapping the data source for an XmlDataProvider. Not to mention a DataTemplateSelector approach to the problem of displaying authors in a list delimited by commas (I know it sounds ridiculously simple, but I wanted to find a suitably WPFy way of doing it). I plan to write something up with sample code soon (I might post it on my web site and just link to it from here, because I'm not entirely satisfied with the way CS treats code embedded in posts).

Development implications of UMPC

So, the hype has come and gone,and now we are temporarily left with nothing but the whining of people complaining that a UMPC makes a crappy iPod...

As I mentioned previously in my recent Geekzone post, Alex Yakhnin has astutely identified the reasons why Windows Mobile/Compact Framework developers are well-placed to take advantage of the UMPC platform (or form factor, or whatever we choose to call it). So anyway, I didn't set out today to indulge in a self-referential link-fest, so it's about time I said something new.

The point I want to make today is that the arrival (sort of) of UMPC devices underlines in big red, um, underlines something that Microsofties have been telling us for a while: it's time to make ourselves resolution-independent. This doevetails quite well with the message that accompanies Avalon  WPF loveliness: we have to ensuure that our content will look good at any size, at any resolution. We can no longer afford to regard the display area as a fixed surface upon which we display visual elements as we see fit. From now on the Windows developer must borrow habits of thought from the web developer, and assume the same flexibility. Our content will be displayed on devices with drastically varying resolutions (compare standard PC with UMPC), and with Vista will be resized, flowed, and generally played with. These are factors we must take into account if we want to avoid producing what would in many cases become junk UI.

Those who regard this prospect with something not unlike excitement will in all probability prosper, whereas those who cling to the certainties of the fixed design surface might as well look for a place in the museum of development of history with all the people who thought there'd never be any call for colour or non-textual UI in a business application.

WPF book goodness

My copy of Programming the Windows Presentation Framework arrived yesterday from Amazon.
I'm looking forward to a very busy weekend of reading and coding (with the odd profanity thrown in of course).
At some point I may remember to eat and sleep, but I'm not making any bets on that subject.

I take my first steps with the May Avalon/Indigo Beta 1 RC

It's good to have a version at last that works with Visual Studio 2005 Beta 2 - apart from the benefits of at least one element of the development setup being relatively stable and robust, it was horribly confusing maintaining different test environments with different versions of the tools.
It's also encouraging to see the spookily-independant-pillars-of-Longhorn (good name for a band, that) inching towards Beta: not only is that encouraging from the point of view of wanting these things to actually see daylight one day rather than lingering on forever in a CTP half-world (in which case Microsoft would have to be renamed Mordorsoft), but it also gives cause to hope that the day might not be far off when things like styling and binding syntax are not drastically refactored every couple of months.

That day has of course not yet come :-)
It goes without saying that I have a lot of catching up to do.
I thoroughly recommend Tim Sneath's article A Hitchhiker's Guide to Avalon Beta 1 RC (original link via Lauren Lavoie's blog) - it's an excellent introduction to some of the changes and especially new features in this release, with clear and relevant examples. Microsoft documentation writers please read and learn One of the features Tim introduces is support for speech (both recognition and synthesis), provided the speech APIs are installed on the machine (which is one reason I'm pleased that I'm using a Tablet PC as my Avalon/Indigo/WinFX test machine). I tried the synthesis side last night and I'm pleased to report that it not only works, but it's as easy to use as it should be. It took me a little while to hunt down the necessary reference (it was cunningly hidden as er, Speech. How was I to know?), but after that it was laughably simple.
Visual Studio was alarmingly sluggish at returning to normal after running a speech app in debug, but I'm not sure how much of that is the SDK integration and how much has to do with the speech engine (I assume there's a lot of interop going on).

I'm still not sure what to make of the new project type, Avalon “Express“ applications. Apparently these are effectively ClickOnce for Avalon, and are tightly sandboxed. The sticking point for me is that they will not be able to use Indigo, which seems to limit their usefulness for data-driven applications. They can however call ASMX web services: that in itself might keep ASMX alive long after it might otherwise be regarded as having been rendered obsolete by Indigo. Actually, I'm assuming (perhaps incorrectly) that the bit about not being able to use Indigo may need to be qualified, since while I have not tried Indigo (yeah, it's on the list) I assume that it is possible to produce an Indigo service which in its relations with the outside world does not differ in any significant respect from an ASMX web service.

Now time to get my head around all the changes...

Some thoughts on the passing of loose XAML

   Since installing the March 2005 Avalon and Indigo CTP I've been working through some of the stuff I'd already done, finding out what changes were necessary to get it running. Today for instance I updated the ThreatLevel (don't ask) demo I showed people at a recent user group meeting (in order to demonstrate data conversion on binding...I'm thinking of extending this to show how converters can be used to localise textual data from web services or similar sources [in other words provide local language substitutions for simple one-word responses], in which case I might post a piece about it here or elsewhere). I've decided however that I won't be updating the XAML version of my CV (it's not like it got me any job offers or anything), since the removal of loose XAML means that I would need to provide an executable to read it (given that it is no longer possible to have XAML docs opening themselves in IE) - and who in their right mind would run something like that? So it didn't really seem worth the effort for something that was after all a pretty daft idea in the first place.
Which brings me to my somewhat rhetorical confused musing: one of the reasons for removing the loose XAML option was apparently (according to a post I came across somewhere) to reduce the attack surface...oh yeah? So to reduce the attack surface we replace the option to host in IE a XAML document that has no ability to do anything at an application or system level (what I mean is it's just UI, for God's sake - no events, no embedded code, nothing except eye candy) with something that absolutely must be compiled (or be loaded from something else that was compiled) or it simply won't work...yep, that makes me feel safer already. Back to perfectly safe Let's-Try-That-.EXE-And-See-What-It-Does land. Oh well.

I know, I'm probably being naive and unduly snarky here and missing the big picture, but I have to say I'm a little bit perplexed as to exactly how this helps.

PS. It also makes at least one of the “How-To“s in the SDK a “How To Do Something Which Won't Actually Work“, which a casual observer might think was a bit of a waste of time, but I'm sure it's good for the soul.

Valentin Iliescu has updated his Avalon chess program...

The 3D and 2D versions have now been updated for the March 2005 CTP.
If you have the Avalon bits, grab the source here.
I'm an abysmal chess player myself, but this program leaves me gobsmacked: I have to admit I take childish delight in zooming in and out of the 3D board.

As a side note, given the complexity of the application that was one quick conversion.

Oh, and in other neat-Avalon-stuff-for-March-CTP news, Mobiform Software have updated the beta of their graphical designer for XAML, Aurora (actually they did this a while ago but it just now occurred to me to mention it...and I'm talking to myself again, aren't I?)

March 2005 CTP progress

I just installed the February VS 2005 CTP and the March 2005 Avalon and Indigo CTP on the tablet I have from work (er, I mean the tablet the NZ taxpayers have...I am one after all). I haven't had the chance to try anything yet, but I have been able to confirm that I do have a working development environment.

Which is nice.

And now it's definitely time for bed. Happy Easter everybody.

March 2005 Avalon and Indigo CTP (updated with correction appended)

I downloaded the new bits (currently available for MSDN subscribers, shortly I hope for everybody else) the other day...now I'm eagerly awaiting Visual Studio 2005 Beta 2 (I think it will be simplest to install the latest goodies in my test environments all in one hit, and otherwise I'd be having to install the February CTP of the .NET Framework v2.0 anyway - I hope to God that this CTP actually does work with VS2005 Beta 2 when that comes out). I can't wait (well obviously I can, since I am, but you know what I mean) to get to grips with Indigo - I liked the PDC version, but it's been a long wait since then. I'm optimistic that it will not be deserving of my proposed slogan for WSE (”WSE - Because .ASMX Doesn't Make You Lose The Will To Live, So We  Had To Have Another Go”).
I just recently got seriously into Avalon for the first time since the PDC bits, so naturally it has now changed quite drastically, as promised. This is understandable however (and hey, it's not even beta software yet, so what could we expect?). In fact this could be viewed as a sign of progress: in 19 years of professional software development it's been my experience that once a significant amount of work has been done on a project it becomes all but impossible to add new or improved features without having a drastic impact on what's already been done (it's obvious that that isn't going to happen when you haven't done anything yet). So the high number of breaking changes highlights the fact that there's now actually quite a lot of Avalon to break.

I recommend the just released article Introducing the March 2005 CTP: What's New in "Avalon" as a starting place.
Hopefully most of the breaking changes will serve as enablers for new capabilities rather than simply being the result of lexical and syntactical hair-splitting, although I have to say that just from reading the examples in the SDK I have already learned to despise StaticResource: there is a certain verbosity in the new XAML syntax that is not altogether appealing.
System.Windows.Document appears to have been significantly gutted (there goes my XAML CV...hopefully I'll come up with a March 2005 version soon though, if only for the appearance of the thing) :I'm not sure whether the tags that were removed were deemed superfluous and/or replaced by features of other new or existing tags, so I'll be keen to learn what the story is there.
I'll miss loose XAML.
I was disappointed to see that media functionality is still absent: maybe they're waiting to get all the perf issues sorted out before including video and sound bits.
Oh, and why was ImageEffect removed and does the functionality it provided still exist? (judging by the blank spaces in the SDK docs I suspect this area is being rethought for some reason).
PS. I hope Valentin Iliescu releases an updated version of his 3D chess program at some point: that's a beautiful piece of software.

I should mention that there are many additions and enhancements in this release (which I won't comment on in depth until I've had a play), including a larger selection of standard UI elements (although still no TreeView unless I'm mistaken, which I could be)

So once again, with equal parts of hope and trepidation, we lurch into the future.

Update 22 March 2005 20:40

As several people have pointed out (most recently Chris Anderson - it's amazing how many people read this thing whenever I demonstrate conclusively that I don't know what I'm talking about :-) ), VS2005 Beta 2 will not be compatible with the March CTP, as I was hoping. I originally thought it might be on the basis of the the references to Beta 2 in the WinFX SDK docs, but they are as we all understand a work in progress so I shouldn't have read too much into that.
This creates something of a challenge when trying to make economical use of testing resources, but such is life. I've found C# Express to be an excellent tool for playing around with Avalon, so it's a bit annoying that there doesn't seem to be an .iso file available for the Feb. CTP in the MSDN subscriber library (there is for VS2005 Professional, but it's over 3G. Urk)...the alternative of downloading the setup file for the C# Express Feb. CTP and then going through the online setup process to drag down the rest is too crappy to be seriously contemplated.
So I think I'll bide my time and wait. For whatever. And so on.
In the meantime I think I'll do a little more Windows Mobile stuff, the Atom API is calling (admittedly I think it's saying “You can't park there, mate“, but never mind)...

My CV in XAML

...(or “My Résumé in XAML“ for those of the North American persuasion).

Recently in a fit of madness I agreed to give a presentation on Avalon to the local .NET users' group, and one of the things I demonstrated was my CV as a stand-alone XAML document.
This is now available here for anyone who's interested: unfortunately my hosting site doesn't serve XAML files directly so I had to zip it up, which means that those who've installed the November 2004 CTP for Avalon will miss out on the “Click here and see it hosted directly in IE” experience they'd otherwise be enjoying (enjoying is possibly putting it too strongly, it's only my CV for God's sake), nevertheless it is a real live XAML document you can download and have a look at in the comfort of your own home, place of work, or wireless-enabled coffee shop etc.
My objective was to demonstrate what you can get out of the box by enclosing some simple markup in <Document...></Document> tags.

And also of course it's my CV (only without all the sex and violence, naturally).