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; }
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 }; }
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; }