How To Style Inactive Window?

I want that the Background changes to Gray if the Window is not the current active Window. I tried this:

<mm:MetroWindow.Style>
    <Style TargetType="{x:Type mm:MetroWindow}">
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="False">
                <Setter Property="Background" Value="Gray" />
            </Trigger>
        </Style.Triggers>
    </Style>
</mm:MetroWindow.Style>

But it does not work, the Background is always Gray, even if the Window is in focus. Did I use the wrong Property or what am I doing wrong?


Use IsActive property:

XAML:

    <Style x:Key="MetroWindowStyle2" TargetType="{x:Type Controls:MetroWindow}">
        <Style.Triggers>
            <Trigger Property="IsActive" Value="False">
                <Setter Property="Background" Value="Gray" />
            </Trigger>
        </Style.Triggers>
    </Style>

Window Inactive Styling, Using some non-standard pseudo selectors, you can change the styling of things when the browser window is inactive. The only "practical" use� Actually, I can see that you are using the theme MahApps.Metro. For that theme, you can just set the property 'NonActiveWindowTitleBrush' as below to control the color of inactive window title. In my below example, I set the inactive window title as white.


You need to add:

        <Trigger Property="IsFocused" Value="True">
            <Setter Property="Background" Value="Red" />
        </Trigger>

(or whatever colour you want the background to be).

You might also have to add:

 <Setter Property="Focusable" Value="true"/>

to your style.

Source

:-moz-window-inactive, :-moz-window-inactive works in content HTML documents, too. Note: Prior to the addition of this pseudo-class, giving different styles to background windows was � The :-moz-window-inactive CSS pseudo-class is a Mozilla extension that matches any element while it's in an inactive window. :-moz-window-inactive works in content HTML documents, too. Note: Prior to the addition of this pseudo-class, giving different styles to background windows was achieved by setting an attribute ( active="true" ) on the top


You need to set the active background in the Style as well. There are several ways a background can by set, and the Style does not come high in the heirarchy. See https://msdn.microsoft.com/en-us/library/ms743230%28v=vs.100%29.aspx

<mm:MetroWindow.Style>
    <Style TargetType="{x:Type mm:MetroWindow}">
        <Setter Property="Background" Value="someColour" />
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="False">
                <Setter Property="Background" Value="Gray" />
            </Trigger>
        </Style.Triggers>
    </Style>
</mm:MetroWindow.Style>

How can I make my active window more obvious on Windows 7 , You can download the style from the Windows 7 Forum in the post Solved - active and inactive windows too similar in Aero. In case the link dies, a copy can be� A VisualStyleElement that represents the title bar of an inactive window. Examples The following code example demonstrates how to create a VisualStyleRenderer with the VisualStyleElement returned by the Inactive property.


Actually, I can see that you are using the theme MahApps.Metro. For that theme, you can just set the property 'NonActiveWindowTitleBrush' as below to control the color of inactive window title. In my below example, I set the inactive window title as white.

<Controls:MetroWindow x:Class="CefSharp.MinimalExample.Wpf.MainWindow"                      
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
                    xmlns:cef="clr-namespace:CefSharp;assembly=CefSharp.Core"

                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                    xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"   

                    NonActiveWindowTitleBrush="White"

>

How To Style Inactive Window? - c#, I want that the Background changes to Gray if the Window is not the current active Window. I tried this: <mm:MetroWindow.Style> <Style TargetType="{x:Type� When the Settings window opens, click Colors on the left side. On the right side, pick an accent color and turn on the “Show color on title bar” setting. When it’s done, Windows 10 will display your selected color for the title bar of any active window. But inactive title bar remains white as usual.


Style for inactive window's selection-background-color?, However, when the window loses focus, the selected text reverts to a different selection color. This is especially troublesome with dark themes,� I also enabled “window tracking” under “XMouse Options” I selected an Inactive Title Bars Color. Then I logged out and back in again. The change to border width and padding t is working. I think this shows that Aero Lite is working. Window tracking is also working. But the color of the inactive window title bar is NOT what I selected.


How to Add Color to Inactive Title Bars in Windows 10, By default, programs' title bars in Windows 10 are white. You can change the color of the active program window, but what about the title bars� CSS states in inactive windows Sciter › Forums › Bug reports › CSS states in inactive windows This topic has 0 replies, 1 voice, and was last updated 2 hours, 20 minutes ago by Mikanoshi .


Tutorial: How to change the color of inactive selected items in , The standard “inactive selection color” of Windows 7 is just too faint. To illustrate that, look at the picture on the left and try to figure out which� A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function. WS_DLGFRAME 0x00400000L: The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar. WS_GROUP 0x00020000L: The window is the first control of a group of