Used for actual processing since Chrome is freezable and don't want to keep states there.
상속: System.Windows.DependencyObject
예제 #1
0
파일: Chrome.cs 프로젝트: soukoku/ModernWPF
        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);
                        }
                    }
                }
            }
        }
예제 #2
0
 void _contentWindow_Closed(object sender, EventArgs e)
 {
     LegacyBorderManager.SetManager(_contentWindow, null);
 }
예제 #3
0
 public static void SetManager(DependencyObject obj, LegacyBorderManager value)
 {
     obj.SetValue(ManagerProperty, value);
 }
예제 #4
0
 public static void SetManager(DependencyObject obj, LegacyBorderManager value)
 {
     obj.SetValue(ManagerProperty, value);
 }