Ejemplo n.º 1
0
        protected override DependencyObject GetContainerForItemOverride()
        {
            var childItem = ExtendedTreeViewItem.CreateItemWithBinding();

            childItem.OnHierarchyMouseUp += OnChildItemMouseLeftButtonUp;

            return(childItem);
        }
Ejemplo n.º 2
0
        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);
        }