Ejemplo n.º 1
0
        private static void _OnChromeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(d))
            {
                return;
            }
            var window    = (Window)d;
            var newChrome = (WindowChrome)e.NewValue;

            Assert.IsNotNull(window);

            var chromeWorker = WindowChromeWorker.GetWindowChromeWorker(window);

            if (chromeWorker == null)
            {
                chromeWorker = new WindowChromeWorker();
                WindowChromeWorker.SetWindowChromeWorker(window, chromeWorker);
            }
            chromeWorker.SetWindowChrome(newChrome);
        }
Ejemplo n.º 2
0
 public static void SetWindowChromeWorker(Window window, WindowChromeWorker chrome)
 {
     Verify.IsNotNull(window, "window");
     window.SetValue(WindowChromeWorkerProperty, chrome);
 }