public void IntermediateSource_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     this.SetValue(HierarchyControl.ItemsSourceProperty, IntermediateSource);
     //recursively set children
     foreach (var child_item in WPFHelper.FindVisualChildren <HierarchyControl>(this))
     {
         child_item.IntermediateSource_CollectionChanged(this, null);
     }
 }
        private void SetParam2(ComboBox ddStringTransformationType, System.Windows.Visibility visibility, string label)
        {
            Label lblParam2 = WPFHelper.FindVisualChildren <Label>(ddStringTransformationType.Parent).Where(t => t.Name == "lblParam2").First();

            lblParam2.Visibility = visibility;
            lblParam2.Content    = label;

            TextBox tbParam2 = WPFHelper.FindVisualChildren <TextBox>(ddStringTransformationType.Parent).Where(t => t.Name == "tbParam2").First();

            tbParam2.Visibility = visibility;
        }
        private static object OnChildrenCoerce(DependencyObject d, object baseValue)
        {
            //(d as HierarchyControl).SetValue(HierarchyControl.ItemsSourceProperty, baseValue);
            var hc = d as HierarchyControl;

            hc.IntermediateSource.ReplaceRange(baseValue as ObservableCollection <GameObject>);
            foreach (var child_item in WPFHelper.FindVisualChildren <HierarchyControl>(hc))
            {
                child_item.IntermediateSource_CollectionChanged(null, null);
            }
            return(baseValue);
        }
        private void DataTemplateLoaded_Loaded(object sender, RoutedEventArgs e)
        {
            Grid     grid     = ((Label)sender).Parent as Grid;
            ComboBox ddColumn = WPFHelper.FindVisualChildren <ComboBox>(grid).Where(t => t.Name == "ddColumn").First();

            foreach (var column in dataObject.Metadata.Columns.Values)
            {
                ddColumn.Items.Add(new ComboBoxItem()
                {
                    Content = column.ColumnName, Tag = column.ColumnName
                });
            }
        }