private static void _OnChromeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { // The different design tools handle drawing outside their custom window objects differently. // Rather than try to support this concept in the design surface let the designer draw its own // chrome anyways. // There's certainly room for improvement here. if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(d)) { return; } var window = (Window)d; var newChrome = (WindowChrome)e.NewValue; Assert.IsNotNull(window); // Update the ChromeWorker with this new object. // If there isn't currently a worker associated with the Window then assign a new one. // There can be a many:1 relationship of to Window to WindowChrome objects, but a 1:1 for a Window and a WindowChromeWorker. WindowChromeWorker chromeWorker = WindowChromeWorker.GetWindowChromeWorker(window); if (chromeWorker == null) { chromeWorker = new WindowChromeWorker(); WindowChromeWorker.SetWindowChromeWorker(window, chromeWorker); } chromeWorker.SetWindowChrome(newChrome); }
private static void _OnChromeWorkerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { Window window = (Window)d; WindowChromeWorker windowChromeWorker = (WindowChromeWorker)e.NewValue; windowChromeWorker._SetWindow(window); }
private static void _OnChromeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (DesignerProperties.GetIsInDesignMode(d)) { return; } Window window = (Window)d; WindowChrome windowChrome = (WindowChrome)e.NewValue; WindowChromeWorker windowChromeWorker = WindowChromeWorker.GetWindowChromeWorker(window); if (windowChromeWorker == null) { windowChromeWorker = new WindowChromeWorker(); WindowChromeWorker.SetWindowChromeWorker(window, windowChromeWorker); } windowChromeWorker.SetWindowChrome(windowChrome); }
public static void SetWindowChromeWorker(Window window, WindowChromeWorker chrome) { Verify.IsNotNull <Window>(window, "window"); window.SetValue(WindowChromeWorker.WindowChromeWorkerProperty, chrome); }
public static void SetWindowChromeWorker(Window window, WindowChromeWorker chrome) { Verify.IsNotNull(window, "window"); window.SetValue(WindowChromeWorkerProperty, chrome); }