This question is locked. New answers and comments are not allowed.
Hi,
My first level collection is an ObservableCollection stored as a DependencyProperty in my usercontrol. This collection has sub-properties that contain the child collections. Using the example in the (offline) help file I have a WCF service being called to load the 2nd level of items OnDemand.
| public ObservableCollection<Batch> Batches |
| { |
| get { return (ObservableCollection<Batch>)GetValue(BatchesProperty); } |
| set { SetValue(BatchesProperty, value); } |
| } |
| public static readonly DependencyProperty BatchesProperty = |
| DependencyProperty.Register("Batches", typeof(ObservableCollection<Batch>), typeof(MyTreeView), new PropertyMetadata(null, BatchesChanged)); |
| public static void BatchesChanged(DependencyObject d, DependencyPropertyChangedEventArgs args) |
| { |
| // not doing anything in the callback |
| } |
But, because the treeview is bound to the DependencyProperty, the UI is not getting updated when the sub-collection is added.
Does anyone have an example of this working?
Thanks,
Matt