Exemple #1
0
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            WindowTab  tab    = (WindowTab)element;
            DockWindow window = (DockWindow)item;

            tab.Window = window;
        }
        private string GetWindowTabText(WindowTab tab)
        {
            if (tab.Window != null)
            {
                return(tab.Window.TabText);
            }

            return(string.Empty);
        }
Exemple #3
0
        private static void OnWindowChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e)
        {
            WindowTab  tab      = (WindowTab)dp;
            DockWindow oldValue = (DockWindow)e.OldValue;
            DockWindow newValue = (DockWindow)e.NewValue;

            if (oldValue != null)
            {
                TypeDescriptor.GetProperties(oldValue)["IsSelected"].RemoveValueChanged(oldValue, tab.OnIsSelectedChanged);
            }
            if (newValue != null)
            {
                TypeDescriptor.GetProperties(newValue)["IsSelected"].AddValueChanged(newValue, tab.OnIsSelectedChanged);
            }
        }
Exemple #4
0
        protected override void ClearContainerForItemOverride(DependencyObject element, object item)
        {
            WindowTab tab = (WindowTab)element;

            tab.Window = null;
        }