Ejemplo n.º 1
0
            public ScopeDescriptor([NotNull] MultiSelectTreeView treeView, [CanBeNull] BaseTreeViewItem item)
            {
                Assert.ArgumentNotNull(treeView, nameof(treeView));

                TreeView = treeView;
                Item     = item;
            }
Ejemplo n.º 2
0
        private void SetScope([NotNull] ScopeDescriptor descriptor)
        {
            Debug.ArgumentNotNull(descriptor, nameof(descriptor));

            TreeView         = descriptor.TreeView;
            RootTreeViewItem = descriptor.Item;
            Content          = TreeView;

            var input = TreeView.SelectedItem as IInputElement;

            if (input != null)
            {
                Keyboard.Focus(input);
            }

            RaiseScopeChanged();
        }
Ejemplo n.º 3
0
        private MultiSelectTreeView CreateTreeView()
        {
            var treeView = new MultiSelectTreeView
            {
                BorderThickness = new Thickness(0),
                AllowDrag       = AllowDrag,
                AllowDrop       = AllowDrop,
                SelectionMode   = SelectionMode.Extended
            };

            treeView.ContextMenuOpening         += OpenContextMenu;
            treeView.KeyDown                    += HandleKeyDown;
            treeView.MouseUp                    += HandleMouseUp;
            treeView.PreviewMouseLeftButtonDown += MouseLeftButton;
            treeView.SelectedItemsChanged       += RaiseSelectedItemsChanged;

            return(treeView);
        }
Ejemplo n.º 4
0
        public void ScopeHome()
        {
            var treeView = CreateTreeView();

            var items = new List <BaseTreeViewItem>();

            GetChildrenPipeline.Run().WithParameters(items, null, null);

            foreach (var baseTreeViewItem in items)
            {
                treeView.Items.Add(baseTreeViewItem);
            }

            Content  = treeView;
            TreeView = treeView;

            _scopes.Push(new ScopeDescriptor(treeView, null));

            RaiseScopeChanged();
        }
Ejemplo n.º 5
0
        public void PushScope([NotNull] BaseTreeViewItem treeViewItem)
        {
            Assert.ArgumentNotNull(treeViewItem, nameof(treeViewItem));

            TreeView = CreateTreeView();
            Content  = TreeView;

            _scopes.Push(new ScopeDescriptor(TreeView, null));

            TreeView.Items.Add(treeViewItem);

            if (treeViewItem.Items.Count > 0)
            {
                treeViewItem.IsExpanded = true;
            }

            Keyboard.Focus(treeViewItem);

            RaiseScopeChanged();
        }