Ensuring Technical Readiness For Copilot in Microsoft 365
XAML: One Language to Rule Them All
1. XAML
One Language to Rule
Them All
Frank La Vigne
Lead Designer
Applied Information Sciences
http://www.franksworld.com
2. Ego Slide
Frank La Vigne
Microsoft MVP: Tablet PC
INETA Membership Mentor for DC,
Maryland and Delaware
Manager DC Silverlight SIG
Lead Designer @ AIS
Blog: www.franksworld.com
Company: www.appliedis.com
Twitter: @Tableteer
Feedback to
Frank.LaVigne@appliedis.com
5. Reach: The Web
Widest possible reach
From text only devices to desktops;
from laptops to mobile phones;
the web works just about anywhere
Platform/Browser Independent*
*Write once, test everywhere in every
conceivable combination.
Hard to debug
Easy to Deploy
User experience varies
6. Rich: Windows Client Application
Richest experience possible
Response time is instantaneous
WPF applications can leverage
hardware acceleration for some truly
engaging user experiences
Easy to Debug
Narrow focus
Deployment concerns
7. RIA: Silverlight Applications
Happy Medium of Reach and Rich
Response time is instantaneous
Runs on Windows, Mac and Linux
Easy to Debug
Wide focus
Easy deployment
Enables great user experiences
12. XBAP Defined
Slightly Better Reach, a Lot More Rich
All the benefits of Silverlight
The Power of WPF in a browser window
3D, Drag & Drop, Printing, Hardware
Acceleration
Easy to Debug
Easy deployment (Windows w/ .NET 3.x)
Enables great user experiences
13. When to Use XBAPs
To quickly push a WPF app
onto the web
When Management demands
that applications be web
based
When Windows is the client
platform
Ideal for corporate intranet
Specialized applications
Quickly moving a WPF
application to the web
24. Different Feature Sets..
Deep Zoom
3D
VC-1 codec
Documents
H.264 codec 3
Drag Drop
HTML integration
Win32 Interop
Sandbox
Triggers
VideoBrush
Commands Plane Projection 3
Printing
Logical tree
Adorners
Hosting WebBrowser
25. Graphics
Hardware acceleration Hardware acceleration 3
Graphics are Multi-core optimizations
Drawings
Lighter weight visuals
Streams
Graphics are
Shapes
Shapes
26. Property System
More inherited properties
Extensible
Property Metadata
Default Values
Coercion
27. Resources
generic.xaml
generic.xaml
Delayed instantiation of XamlReader can load
StaticResources Resource Dictionaries.
Merged Resource
Dictionaries
FindResource walks
the tree
Freezables
28. Databinding
UIElement to UIElement bindings UIElement to UIElement bindings 3
MultiBinding Binding support at FrameworkElement
Binding support at DependencyObject No TargetType on data templates
Dictionaries
Relative bindings
Template selectors
More Type converters out of the box
29. Eventing
Events are synchronous Events are asynchronous
Not all events bubble, even
Tunneling (Preview) events
if declared as Routed
Mouse Wheel
30. Styles
Write-once
No app themes
No BasedOn
No triggers
31. Animation
MotionPath Animation Named key-frames
CompositionTarget.Rendering Storyboard APIs
More animatable types
Begin, Stop, etc.
Extensibility
Storyboard APIs added in 3.5 SP1
32. Input
Support for other platforms
Key.Unknown
ModifierKeys.Apple
KeyEventArgs.PlatformKeyCode
36. Tips & Tricks for Recycling XAML
Source compatibility
(not binary compatibility)
It is a different framework
Code to Silverlight
(Common Denominator)
Create a different VS project for each ‘run-time’
Link the files together
Use WPF’s XML namespace declaration
xmlns=quot;http://schemas.microsoft.com/winfx/2006/xaml/p
resentationquot;
37. Tips & Tricks for Recycling Source Code
Use #if for small logic
Move all conditional logic to code
(no #if in XAML)
Partial classes for larger chunks
Can use separate files altogether
Place Templates and styles in App.xaml
(both platforms can pick from there)
38. Other API differences
OpenFileDialog
SL = System.Windows.Controls
WPF: Microsoft.Win32
Dispatcher.BeginInvoke different signatures
SL has more classes sealed
(can’t be inherited)
XamlReader.Load
SL = XamlReader.Load ( string )
WPF = XamlReader.Load ( stream )
39. Other API differences (cont’d)
ContentPresenter
SL : class ContentPresenter : Control
WPF : class ContentPresenter : FrameworkElement
UIElementCollection
SL : UIElementCollection :
PresentationFrameworkCollection<UIElement>
WPF : UIElementCollection :
IList, ICollection, Ienumerable
40. THANK YOU!
Frank La Vigne
www.FranksWorld.com
frank@franksworld.com
@Tableteer