Esempio n. 1
0
        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 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);
        }
        // Token: 0x06000ECD RID: 3789 RVA: 0x00038AB8 File Offset: 0x00036CB8
        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);
        }