Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Updating xamDataTree ItemsSource
posted

I have an application where the underlying data for my xamDataTree is contained in an instance of a custom class similar to your DataUtil example, except I'm using instance members instead of static members to initialize the data.  This allows me to build the data dynamically while the application is initializing.  As part of the app initialization, I build up the data in memory, then set the xamDataTree.ItemsSource property to bind the data to the xamDataTree control.  All this is working fine.  Later (after initial app init), the app becomes aware of new tree data (provided externally), at which point the app updates the xamDataTree's underlying data object.  In order to get the new data to be updated in the xamDataTree control, my code sets the xamDataTree.ItemsSource property over again to re-bind the data.  Is this the preferred method of dynamically updating the data binding for the xamDataTree control or is there a better method (like using WPF triggers or events)?