Exemple #1
0
        public DockTabViewItem(DockItem dockItem)
        {
            this.OverrideStyleKey <DockTabViewItem>();

            DockItem = dockItem;

            SetBinding(HeaderProperty, new Binding {
                Path = new PropertyPath(DockItem.TitleProperty), Source = dockItem
            });
            SetBinding(IconProperty, new Binding {
                Path = new PropertyPath(DockItem.IconProperty), Source = dockItem
            });
            SetBinding(DisplayIndexProperty, new Binding {
                Path = new PropertyPath(BaseLayout.GetDockItemIndexProperty <TabLayout>()), Source = dockItem, Converter = DisplayIndexConverter.Instance, Mode = BindingMode.TwoWay
            });

            DataContext = dockItem;

            DragOutBehavior = new DragOutBehavior
            {
                DragOutCommand       = new RelayCommand(OnDragOutCommandExecuted),
                ProcessHandledEvents = true,
                Target = this
            };

            CloseCommand          = StaticCloseCommand;
            CloseCommandParameter = this;
        }
Exemple #2
0
        public AutoHideTabViewItem(DockItem dockItem)
        {
            DockItem = dockItem;

            ItemPresenter = new AutoHideDockItemPresenter(this)
            {
                Visibility = Visibility.Collapsed
            };

            SetBinding(DockSideProperty, new Binding {
                Path = PropertyPath, Source = dockItem
            });

            dockItem.IsSelectedChanged += OnIsSelectedChanged;

            _showAction = new DelayAction(Show);
            _hideAction = new DelayAction(Hide);

            DragOutBehavior = new DragOutBehavior
            {
                DragOutCommand       = new RelayCommand(OnDragOutCommandExecuted),
                ProcessHandledEvents = true,
                Target = this
            };
        }
Exemple #3
0
        protected DockItem(DockItemState dockState)
        {
            this.OverrideStyleKey <DockItem>();

            _dockState = dockState;

            foreach (var layoutProperty in FullLayout.LayoutProperties)
            {
                this.AddValueChanged(layoutProperty, OnLayoutPropertyChanged);
            }

            DragOutBehavior = new DragOutBehavior
            {
                DragOutCommand = new RelayCommand(OnDragOutCommandExecuted)
            };

            this.BindProperties(NameInternalProperty, this, NameProperty, BindingMode.TwoWay);

            LayoutUpdated += OnLayoutUpdated;
        }