This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Overview
Download & View Adding Style To Your Microsoft Wpf And Silver Light Applications as PDF for free.
Agenda • Quick overview of WPF / Silverlight / XAML • PART 1 - Data Binding • • • • •
Element to Element Data Binding Binding to Objects Binding to Collections Master-Detail Binding Data Binding and the Debugger
• PART 2 - Styles & Templates • • • • • • •
Creating Custom Styles Inherited Styles “Apply to All” Styles Themes Creating Control Templates Custom Data Templates Visual State Manager (if time permits)
Windows Presentation Foundation
Microsoft Silverlight is a cross-browser cross-platform cross-device implementation of .NET for building and delivering the next generation of
media experiences & rich interactive applications
Silverlight Runtime Requirements
XAML: Declarative Programming for Windows Markup for Windows •
• •
Build applications in simple declarative statements Also used in WF for defining workflows
Code and content are separate
•
•
Streamline collaboration between designers and developers
Button b1 = new Button(); b1.Content = "OK"; b1.Background = new SolidColorBrush (Colors.LightBlue); b1.Width = 100;
Dim b1 As New Button b1.Content = "OK" b1.Background = New _ SolidColorBrush _ (Colors.LightBlue) b1.Width = 100
Data Binding Binding Target
Binding Source
Dependency Object
Object
Dependency Property
OneWay TwoWay OneWayToSourc e
Property
<StackPanel>
• UI can be bound to CLR objects or XML • Dependency properties can also be bound to ADO.NET and objects associated with Web Services and Web properties • Sort, filter, and group views can be generated on top of the data • Data templates can be applied to data
<StackPanel> <StackPanel.Triggers> <EventTrigger RoutedEvent=“Button.Click"> <EventTrigger.Actions> <Storyboard> ... … remainder of contents of StackPanel, including x:Name'd TheBrush and LowerEllipseTransform …