Wednesday, May 31, 2006 4:07 AM
Shawn A. Van Ness
AutoClaimsFX
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!