November 2009 - Posts
Another update to testapi is up on codeplex @ http://codeplex.com/testapi.
TestApi is a library of test and utility APIs that enables developers and testers to create testing tools and automated tests for .NET and Win32 applications. TestApi provides a set of common test building blocks -- types, data-structures and algorithms -- in a simple, layered, componentized and documented stack.
This release adds:
- A new deep object comparison library
- A new text string generation library
- A new leak detection library
- Tagged and weighted values for combinatorial variation generation
- New samples and documentation
We announced and showed off the new Microsoft XAML Toolkit CTP last week at PDC09’s XAML Futures talk.
Michael Shim now blogs:
(Michael, a program manager on the XAML/WPF/Silverlight teams, has a new blog that you should read regularly.)
Best Week Ever
This may have been the best ever week for XAML UI. I’m smiling!
WPF 3 & WPF 4
I was excited about several exciting applications for Windows (built with WPF) shown or announced during PDC09 this week:
1) Microsoft Visual Studio 2010 beta 2 – a flagship application from Microsoft betting on improving the user experience.
2) Seesmic for Windows – a twitter client that feels very nice!
3) Microsoft Live Labs Pivot – a great way to explore and visualize data.
4) Fishbowl for Facebook by UXLabs@Microsoft – a great Windows 7 application for Facebook. (source code available!)
Silverlight 4
Tools for XAML UI
On the Tools front, several exciting developments are available
Many more things I could probably add…but it is 1am and my flight is at 6:20am…I should quit for now…
Here are the WPF focused sessions at PDC09. If you are attending, we hope to see you there. If not, videos will be posted of the sessions later this week…click on the links.
The team also has a booth in the Big Room (in the Web Platform area near Silverlight/Expression) and will generally have at least one person there.
There are two Hands on Labs focused on WPF 4…(these are CLI09 and CLI10 if I recall).
We’ll be at ask the experts on Wednesday night from 5:30 to 7.
We look forward to seeing you!
| TUE 11/17/2009 11:00AM - 12:00PM | PDC09-CL09 How Microsoft Visual Studio 2010 Was Built with Windows Presentation Foundation 4 |
| TUE 11/17/2009 4:30PM - 5:30PM | PDC09-CL11 Advanced Windows Presentation Foundation Application Performance Tuning and Analysis | Room Petree Hall D | | Capacity 1065 | |
| WED 11/18/2009 11:00PM - 12:00PM (LUNCH) | Bonus Chalk Talk Deep Dive into WPF4 Multi-Touch APIs |
| WED 11/18/2009 12:30PM - 1:15PM (LUNCH) | PDC09-CL31 Mastering WPF Graphics and Beyond | Room Hall E - 151 (split screen) | | Capacity 1115 | |
| THUR 11/19/2009 10:00AM- 11:00AM | PDC09-CL10 Windows Presentation Foundation 4 Plumbing and Internals | Room Hall E - 151 (split screen) | | Capacity 1115 | |
| THUR 11/19/2009 11:30AM - 12:30PM | PDC09-CL27 Microsoft Surface: Multi-touch Development Integration with Windows 7 and WPF 4 | Room Petree Hall C | | Capacity 932 | |
| THUR 11/19/2009 1:45PM - 2:45PM | PDC09-CL24 XAML Futures in Microsoft .NET Framework, Microsoft Silverlight and Tools | Room Hall F - 153 (split screen) | | Capacity 1115 | |
Jonathan Aneja blogged for the VB Team about cases where a developer creates an event handler in XAML and uses the Handles clause on a method. You end up with the same event firing twice.
A XamlFxCop rule could be written to help detect this case. See the #pdc09 XAML Futures talk on Thursday in LA or soon afterwards online to learn more about #XAMLFxCop.
Should the XAML Compiler + VB Compiler be enhanced to check for this as well? Let’s talk Jonathan….
Thursday’s…
PDC09’s XAML Futures talk will show off several demos…one of them will be a demo of .NET 4’s System.Xaml.dll and the DLR.
Code intertwined with markup, generally isn’t best practice, but I’ve talked with several customers who have wanted to enable customization scenarios with markup + script. BAML and IL didn’t seem to help their scenarios. And XAML by itself doesn’t have ability to have code. There have been .NET 3 explorations of DLR + XAML as well. (DLRPad. Events in compiled and uncompiled scenarios.)
XamlScriptServices.Parse() Explanation
My demo creates a class called XamlScriptServices. When you call XamlScriptServices.Parse(xamlString), it will give allow you to put Ruby script inside of x:Code, and events. Named elements will be accessible from script. Events with an leading "[" and a trailing "]" will be treated as Ruby code to wire to the event. Other event handlers will be attempted to be wired to that method on the root object. The demo currently enables one x:Code block per parent element.
Other DLR languages could be chosen instead, the class could even be enhanced to enable specifying the script engine via some attribute in the XAML.
The Markup + Ruby Sample
This is just a technology demo, but I’d *love to hear what you think*…remember this is a tool for some scenarios…not all.
- <Page
- xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
- xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xml:space='preserve'>
- <Page.Loaded>[<![CDATA[
- tb1.Tag = Car.new('the beach')
- ]]>]</Page.Loaded>
- <Page.LayoutTransform>
- <ScaleTransform ScaleX='3' ScaleY='3' />
- </Page.LayoutTransform>
- <UniformGrid Columns='2' Rows='4'>
- <Button Click='[tb1.Text=tb1.Tag.go()]'>go</Button>
- <Button Click='[tb1.Text=tb1.Tag.stop()]'>stop</Button>
- <Label Target='tb1' >tb1:</Label>
- <TextBox Name='tb1' />
- <Label Target='tb2'>tb2:</Label>
- <TextBox Name='tb2' />
- <Label Target='tb3'>tb3:</Label>
- <TextBox Name='tb3' />
- </UniformGrid>
-
-
- <x:Code><![CDATA[
- class Car < Object
- attr_accessor :destination
- def initialize(destination)
- @destination = destination
- end
- def go()
- 'starting'
- end
- def stop()
- 'stopping'
- end
- end
- ]]></x:Code>
- </Page>
(Haven’t figured out how to avoid storing the Car object in tb1.Tag. Ideally a variable created in Page.Loaded would be available from other script blocks. Digging more into DLR script hosting at http://dlr.codeplex.com/)
Email from customer (I’ll keep them anonymous unless they want to chime in):
…
I have several questions and I would really appreciate it if you have time to answer some of them.
1) In your post "http://blogs.windowsclient.net/rob_relyea/archive/2009/03/25/xaml-in-net-4-update.aspx" you mention a WPF localization review. I'm really curious about the results J. Are there any plans for a different/better localization support for WPF?
RR: short term, our plan is to convert our x:Uid based localization to support XAML or BAML. This would allow a few things. A) it would allow using the technique in Silverlight XAML. B) it would enable VS or other tools to do similar things to ASP.NETs “meta:resourceKey & Tools/Generate Local Resource”. We continue to want to hear feedback from customers in this area.
2) Is beta 2 api complete regarding xaml, or will there be changes for rtm? You mention featuers like "BamlReaderAsText" and "BamlWriter", which I can't find in the beta 2 release.
RR: The API is mostly complete. There aren’t major changes post-Beta2.
BamlWriter is not shipping in .NET 4. BamlReader as text is Baml2006Reader created with Baml2006ReaderSettings.ValuesMustBeString… we affectionately call this “BRAT” mode. We have 1 major BRAT bug that we are still attempting to fix before we ship…
3) What is the current WPF localization process at Microsoft, for example for Visual Studio or Blend? Which tools do you use? (probably not locbaml ;-) )
RR: Microsoft uses its own homemade localization tool. We adapted baml localization into this tool with a plugin that we call PomBaml – both locBaml and pomBaml call into the same APIs in PresentationFramework to Extract and Merge values from/to BAML. Instead of extracting to .csv and merging from .csv, pomBaml extract to the loc database and merge from the loc database. We’ve learned a lot from the localization of Expression and VS and plan to improve the techniques to improve things for internal and external localizers of BAML.
4) BamlLocalizer needs to load assemblies. This requires me to handle the AssemblyResolve event. However, the AssemblyResolve event is not executed when my localization tool runs in the context of Visual Studio (AssemblyResolve doesn't work there). Are there any plans to change this behavior for BamlLocalizer, or any workarounds?
RR: we realize this is a major problem with our v3 (and now v4) localization story. We plan to address the assembly loading problem by moving off of the v3 BamlLocalization codepaths to use a new Microsoft.Xaml.Localization.dll codepath that will support XAML or BAML. As part of this we plan to support XAML and BAML scenarios with less assembly dependencies. We have 2 potential strategies, a plan A and plan B, that we will be doing.
We plan on demoing Microsoft.Xaml.Localization.dll at PDC…and hopefully a CTP soon.
5) You mentioned that you were working on a new UpdateUid/Checkuid (http://blogs.windowsclient.net/rob_relyea/archive/2009/08/08/x-uids-should-we-have-updateuid-to-create-fewer-of-them.aspx). Will this be part of the .net framework, or are you going to publish this somewhere?
RR: At the PDC we plan on demoing a Microsoft.Xaml.Tools.dll that includes the initial work to make x:Uid more selective…and hopefully a CTP soon.
…
Found a post from Nigel Spencer about a MobileUI framework that can target Windows Mobile 6.5 that has XAML markup support for the WindowsForms framework.
As a new owner of an HTC Imagio, perhaps I’ll give this a try.
I think XAML for the phone has some potential…
I was searching for “WPF” on microsoftpdc.com, and I found a great video clip with Robert Hess and Don Box talking about the history of PDC’s.
At about 4:00, they show a long clip from PDC2001 where Rebecca Norlander, Group Program Manager of “Avalon” at the time, did an early demo of WPF…focusing mostly on the animation.
Right after that, they switched to a video feed of Bill Gate’s launching Windows XP.
Before I stumbled on this video, I hadn’t even remembered that we had demoed early WPF before PDC2003.
Interested in WPF v4, here are some good links:
We’ll have many WPF team members this month at PDC09…drop by and tell us (or show us) what your doing with WPF, ask questions, give feedback, etc…
Happy to see more work on file converters from other formats to XAML. See “SVG to XAML Converter” for details on these 4 apis:
- public Canvas SvgToCanvas(string svgString);
- public string SvgToXaml(string svgString);
- public Canvas SvgFileToCanvas(string svgFilePath);
- public string SvgFileToXaml(string svgFilePath);
I like to see converters support targeting both XAML and an Object graph directly. System.Xaml.dll (in .NET 4) provides a great foundation to support both, more easily than doing it yourself.