Ejemplo n.º 1
0
        //...

        public TreeViewRow() : base()
        {
            SetCurrentValue(SplitterVisibilityProperty, false);
            this.AddHandler(i =>
            {
                treeViewItem
                    = this.FindParent <TreeViewItem>() ?? throw new NotSupportedException();
                treeView
                    = treeViewItem.FindParent <TreeView>();

                if (treeView != null)
                {
                    treeView.RemoveChanged
                        (TreeViewExtensions.ModeProperty, OnTreeViewModeChanged);
                    treeView.AddChanged
                        (TreeViewExtensions.ModeProperty, OnTreeViewModeChanged);

                    Reset();
                }
            }, i =>
            {
                if (treeView != null)
                {
                    treeView.RemoveChanged(TreeViewExtensions.ModeProperty, OnTreeViewModeChanged);
                    Unsubscribe();
                }
            });
        }