Download presentation
Presentation is loading. Please wait.
Published bySamantha Wilcox Modified over 9 years ago
3
Target: dependency property Source: any public property CLR and WPF properties Target: dependency property Source: any public property CLR and WPF properties Control “Data Item” Source Property Binding Target Property ADO.NETXML CLR Objects LINQ Web Services WPF Elements
5
Add to resource dictionary Named source objects Use with resource binding {StaticResource solarSystem} <ObjectDataProvider x:Key=“solarSystem” ObjectType=“{x:Type l:SolarSystem}" />... <TextBlock TextContent="{Binding Path=Sun.Name, Source={StaticResource solarSystem} }" />
6
Text= {Binding Path=Sun.Name Source={StaticResource solarSystem}} Source= {Binding Path=Sun.Image Source={StaticResource solarSystem}} StackPanel Image TextBox DataContext= {Binding Path=Sun Source={StaticResource solarSystem}} Text= {Binding Path=Name} Source= {Binding Path=Image} DataContext= {Binding Path=SunAndPlanets[3] Source={StaticResource solarSystem}}
8
Property Changes INotifyPropertyChanged PropertyChanged event pattern Collection Changes INotifyCollectionChangedObseverableCollection<T>BindingList<T>
10
class SolarSystemObject { Uri Image {get;set} string Name {get;set} }
11
By name (resource dictionary key) ContentTemplate/ItemTemplate= {StaticResource myStyle} By type for XML for XML
14
Wraps the Underlying Collection SortingFilteringGroupingSelection ItemsControl create default CollectionView CollectionViewSource creates a CollectionView in XAML Allows Grouping, Sorting etc in Markup Contains Source and View Properties Not available in Silverlight 2
16
Use ItemsControl (e.g. ListBox) as master Set IsSynchronizedWithCurrentItem="True" Other bindings on same source will follow master Alternative: bind to selected item/value {Binding Path=SelectedValue.Name, ElementName=myListBox } Fragile on UI changes
18
<HierarchicalDataTemplate ItemsSource="{Binding XPath='*'}">
19
New Debugging Mechanism Support for IDataErrorInfo Alternative Syntax for Data Validation LINQ Support
20
WPF understands your data Use your favorite data model: XML, objects, SQL, LINQ, WS, … Bind data to controls Templates give your data a face Controls “think” data Data is pervasive across and integrated into the platform
22
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.