May 2006 - Posts

In celebration of WinFX Beta2, I've attempted to recreate the Tablet PC SDK's beloved AutoClaims sample in WPF.

This sample demonstrates: 

  • InkCanvas
    • collecting ink in multiple transparent layers, over an Image resource
    • databinding for Strokes
    • DefaultDrawingAttributes defined in static resources
    • animated Opacity and ZIndex properties for smooth transitions among layers
  • TextBox.InputScope
    • defines a pattern to coerce Tablet Input Panel handwriting recognition for the Year (YYYY) field
  • Scrolling and resizing
    • relative layout techniques
    • ScrollViewer around the Image and InkCanvas elements

...all in 100% pure XAML!

http://www.windojitsu.com/blog/autoclaimsfx.html

Ok, admittedly it probably would've been easier to code some of those lengthy EventTriggers for managing the layers in C#.  And I'm a little bummed to discover than I can't set Panel.ZIndex in partial trust (else you'd be running this app in your browser right now, not reading about it).

Still, it's a fun exercise in what can be done with InkCanvas and XAML, with so few lines of code compared to our WinForms platform.  You really have to compile and run the mundane old WinForms version, and peruse the code, to appreciate this WPF rendition.

Have fun!

I'll be hosting a WebCast on MSDN tomorrow (Tuesday, May 23rd) 12 to 1pm Pacific time...  should I reprise my PDC'05 talk, or should I just spend the whole hour writing code?  There's so much cool stuff to show off, for the upcoming beta release...

http://msevents.microsoft.com/cui/webcasteventdetails.aspx?eventid=1032294694&eventcategory=4&culture=en-us&countrycode=us

Description:

Part of the WinFX Runtime Components 3.0, Windows Presentation Foundation (formerly code-named "Avalon") incorporates a number of features previously found only on the Tablet PC platform, such as digital ink and stylus input. This means WinFX applications will be able to collect, render, and edit digital ink on any system—not just Tablet PC systems. It also means Tablet PC applications will be able to do things that were not possible before, such as collect ink over video, or render ink in 3-D. Join this webcast to learn about the InkCanvas element, Stylus input events, and other Windows Presentation Foundation features that can help you develop richer Tablet PC applications in less time.

Presenter: Shawn Van Ness, Program Manager, Microsoft Corporation

More Posts