Newbie data template/DataContext question
-
So I got inspired at work to learn WPF and Xaml. Cool technologies indeed, especially the data template stuff! Anyway, I've been playing around with the TreeView control. I've successfully bound it to my data structure using the HierarchicalDataTemplate element. Now to my question: how do I propagate changes in my data to the control? Resetting the DataContext property to my data didn't do anything at all (which was expected - same reference being used!).
-- Kein Mitleid Für Die Mehrheit
-
So I got inspired at work to learn WPF and Xaml. Cool technologies indeed, especially the data template stuff! Anyway, I've been playing around with the TreeView control. I've successfully bound it to my data structure using the HierarchicalDataTemplate element. Now to my question: how do I propagate changes in my data to the control? Resetting the DataContext property to my data didn't do anything at all (which was expected - same reference being used!).
-- Kein Mitleid Für Die Mehrheit
If you bind to an
Observeable
collection your changes will automatically be displayed.Cheers, Karl
» CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your ArticlesJust a grain of sand on the worlds beaches.
-
If you bind to an
Observeable
collection your changes will automatically be displayed.Cheers, Karl
» CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your ArticlesJust a grain of sand on the worlds beaches.
Thanks! I will try it as soon as I get home. :)
-- Kein Mitleid Für Die Mehrheit