Inheritance: System.Windows.DependencyObject
Ejemplo n.º 1
0
        public BorderWindow(BorderManager manager)
        {
            // only works if set directly, no in override
            this.Background = Brushes.Transparent;

            _manager = manager;

            CreateBinding(IsActiveProperty.Name, _manager.ContentWindow, IsContentActiveProperty);
            UpdateChromeBindings(Chrome.GetChrome(_manager.ContentWindow));
        }
Ejemplo n.º 2
0
        private static void ChromeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(d)) { return; }

            Window window = d as Window;
            if (window != null)
            {
                // don't care about old chrome since it has no state
                Chrome newChrome = e.NewValue as Chrome;

                if (__legacyBorder)
                {
                    if (newChrome == null)
                    {
                        LegacyBorderManager.SetManager(window, null);
                    }
                    else if (e.NewValue != e.OldValue)
                    {
                        var worker = LegacyBorderManager.GetManager(window);
                        if (worker == null)
                        {
                            worker = new LegacyBorderManager();
                            LegacyBorderManager.SetManager(window, worker);
                        }
                        else
                        {
                            worker.UpdateChrome(newChrome);
                        }
                    }
                }
                else
                {
                    if (newChrome == null)
                    {
                        BorderManager.SetManager(window, null);
                    }
                    else if (e.NewValue != e.OldValue)
                    {
                        var worker = BorderManager.GetManager(window);
                        if (worker == null)
                        {
                            worker = new BorderManager();
                            BorderManager.SetManager(window, worker);
                        }
                        else
                        {
                            worker.UpdateChrome(newChrome);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public static void SetManager(DependencyObject obj, BorderManager value)
 {
     obj.SetValue(ManagerProperty, value);
 }
Ejemplo n.º 4
0
 private void ContentWindow_Closed(object sender, EventArgs e)
 {
     BorderManager.SetManager((Window)sender, null);
 }
Ejemplo n.º 5
0
 public static void SetManager(DependencyObject obj, BorderManager value)
 {
     obj.SetValue(ManagerProperty, value);
 }