Beispiel #1
0
        private void InternalSetSelectedAnchorable(LayoutAnchorableItem anchorableToSelect)
        {
            _internalSetSelectedAnchorable = true;
            this.SelectedAnchorable        = anchorableToSelect;
            _internalSetSelectedAnchorable = false;

            if (_anchorableListBox != null)
            {
                _anchorableListBox.Focus();
            }
        }
Beispiel #2
0
        private bool CanExecuteHideWindowCommand(object parameter)
        {
            if (this.Model == null)
            {
                return(false);
            }
            ILayoutRoot root = this.Model.Root;

            if (root == null)
            {
                return(false);
            }
            DockingManager manager = root.Manager;

            if (manager == null)
            {
                return(false);
            }
            bool flag = false;

            LayoutAnchorable[] array = this.Model.Descendents().OfType <LayoutAnchorable>().ToArray <LayoutAnchorable>();
            int num = 0;

            while (num < (int)array.Length)
            {
                LayoutAnchorable layoutAnchorable = array[num];
                if (layoutAnchorable.CanHide)
                {
                    LayoutAnchorableItem layoutItemFromModel = manager.GetLayoutItemFromModel(layoutAnchorable) as LayoutAnchorableItem;
                    if (layoutItemFromModel == null || layoutItemFromModel.HideCommand == null || !layoutItemFromModel.HideCommand.CanExecute(parameter))
                    {
                        flag = false;
                        break;
                    }
                    else
                    {
                        flag = true;
                        num++;
                    }
                }
                else
                {
                    flag = false;
                    break;
                }
            }
            return(flag);
        }
        void CreateAnchorableLayoutItem(LayoutAnchorable contentToAttach)
        {
            if (_layoutItems.Any(item => item.LayoutElement == contentToAttach))
                return;

            var layoutItem = new LayoutAnchorableItem();
            layoutItem.Attach(contentToAttach);
            ApplyStyleToLayoutItem(layoutItem);
            _layoutItems.Add(layoutItem);

            if (contentToAttach != null &&
                contentToAttach.Content != null &&
                contentToAttach.Content is UIElement)
            {
                InternalAddLogicalChild(contentToAttach.Content);
            }
        }