Posted By

qrist0ph on 03/12/10


Tagged

WPF xaml dataBinding


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


WPF DataBinding


 / Published in: XML
 

  1. <StackPanel>
  2. <StackPanel.Resources>
  3. <XmlDataProvider x:Key="MoreColors" XPath="/colors">
  4. <x:XData>
  5. <colors >
  6. <color name="pink"/>
  7. <color name="white"/>
  8. <color name="black"/>
  9. <color name="cyan"/>
  10. <color name="gray"/>
  11. <color name="magenta"/>
  12. </colors>
  13. </x:XData>
  14. </XmlDataProvider>
  15.  
  16. </StackPanel.Resources>
  17. <ListBox x:Name="lbColor" Width="248" Height="56"
  18. IsSynchronizedWithCurrentItem="True"
  19. ItemsSource="{Binding Source={StaticResource MoreColors},
  20. XPath=color/@name}">
  21. </ListBox>
  22. </StackPanel>

Report this snippet  

You need to login to post a comment.