Exemplo n.º 1
0
        public ModernWindow()
        {
            CommonResources.InitializeControlResouces(Resources, "Controls");
            //CommonResources.InitializeControlResouces(Resources, "VS/Window");
            WindowTitleBrush = new SolidColorBrush(Common.GetSystemThemeColor());
            Binding binding = new Binding()
            {
                Path = new PropertyPath("WindowTitleBrush"), RelativeSource = new RelativeSource(RelativeSourceMode.Self)
            };

            SetBinding(GlowBrushProperty, binding);
            WindowButtonCommands = new WindowButtonCommands();
            OverrideDefaultWindowCommandsBrush = Brushes.White;
            BorderThickness           = new Thickness(0);
            NonActiveWindowTitleBrush = Brushes.White;

            //UISettings ui = new UISettings();
            //ui.ColorValuesChanged += (p1, p2) =>
            //{
            //    if (WindowTitleBrushBindingSystemThemeColor)
            //    {
            //        var color = ui.GetColorValue(UIColorType.Accent);
            //        Dispatcher.Invoke(() => WindowTitleBrush = new SolidColorBrush(new Color() { A = color.A, R = color.R, G = color.G, B = color.B }));

            //    }
            //};
        }
Exemplo n.º 2
0
 //window buttons (close, maximize, minimize) need to be reinitialized to be shown correctly
 private void initWindowButtons()
 {
     WindowButtonCommands = new WindowButtonCommands();
     WindowButtonCommands.ParentWindow = this;
 }