public static FrameworkElement Create (FrameworkElement content, TreeController controller) { var panel = new StackPanel { Orientation = swc.Orientation.Horizontal }; var button = new TreeToggleButton { Controller = controller, Width = 16 }; panel.Children.Add (button); panel.DataContextChanged += (sender, e) => button.Configure(panel.DataContext as ITreeGridItem); panel.Children.Add (content); return panel; }
public static FrameworkElement Create(FrameworkElement content, TreeController controller) { var dock = new DockPanel(); var button = new TreeToggleButton { Controller = controller, Width = 16 }; DockPanel.SetDock(button, Dock.Left); dock.Children.Add(button); dock.DataContextChanged += (sender, e) => button.Configure(dock.DataContext as ITreeGridItem); dock.Children.Add(content); return(dock); }
public TreeTogglePanel(FrameworkElement content, TreeController controller) { Background = swm.Brushes.Transparent; // needed? button = new TreeToggleButton { Controller = controller, Width = 16 }; SetDock(button, Dock.Left); Children.Add(button); Children.Add(content); _content = content; DataContextChanged += OnDataContextChanged; }
public static FrameworkElement Create(FrameworkElement content, TreeController controller) { var panel = new StackPanel { Orientation = Orientation.Horizontal }; var button = new TreeToggleButton { Controller = controller, Width = 16 }; panel.Children.Add(button); panel.DataContextChanged += (sender, e) => button.Configure(panel.DataContext as ITreeGridItem); panel.Children.Add(content); return(panel); }