protected override DependencyObject GetContainerForItemOverride() { var childItem = ExtendedTreeViewItem.CreateItemWithBinding(); childItem.OnHierarchyMouseUp += OnChildItemMouseLeftButtonUp; return(childItem); }
public static ExtendedTreeViewItem CreateItemWithBinding() { var tvi = new ExtendedTreeViewItem(); var expandedBinding = new Binding("IsExpanded"); expandedBinding.Mode = BindingMode.TwoWay; tvi.SetBinding(ExtendedTreeViewItem.IsExpandedProperty, expandedBinding); var selectedBinding = new Binding("IsSelected"); selectedBinding.Mode = BindingMode.TwoWay; tvi.SetBinding(ExtendedTreeViewItem.IsSelectedProperty, selectedBinding); return(tvi); }