Skip to content

MicaWindow Properties

Simnico99 edited this page Jul 14, 2023 · 11 revisions

Contents

Table of Contents
  1. SystemBackdropType
  2. CaptionHeight
  3. ChangeTitleColorWhenInactive
  4. TitleBarContent
  5. TitleBarType

SystemBackdropType

The SystemBackdropType property will dictate how the background of the window will behave see results to see the type available.

Usage Exemple:
<mica:MicaWindow  
        x:Class="MicaWPF.DesktopApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MicaWPF.DesktopApp"
        mc:Ignorable="d"
        Title="MainWindow" 
        Height="450" 
        Width="800"
        SystemBackdropType="Tabbed"
        xmlns:mica="clr-namespace:MicaWPF.Controls;assembly=MicaWPF" >
    <Grid>

    </Grid>
</mica:MicaWindow>
Results:
SystemBackdropType="Mica" <!-- This is the default one --> 

Mica_Exemple

SystemBackdropType="Tabbed"

Tabbed_Exemple

SystemBackdropType="Acrylic"

Acrylic_Exemple

SystemBackdropType="None"

None_Exemple

CaptionHeight

The CaptionHeight property will change the size of the grabbable area in the title bar, this means when grabbing the window the area will be this size in pixel.

Usage Exemple:
<mica:MicaWindow  
        x:Class="MicaWPF.DesktopApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MicaWPF.DesktopApp"
        mc:Ignorable="d"
        Title="MainWindow" 
        Height="450" 
        Width="800"
        CaptionHeight="45"
        xmlns:mica="clr-namespace:MicaWPF.Controls;assembly=MicaWPF" >
    <Grid>

    </Grid>
</mica:MicaWindow>

ChangeTitleColorWhenInactive

The ChangeTitleColorWhenInactive property changes if the text Titlebar text will change color when the Window is inactive.

Usage Exemple:
<mica:MicaWindow  
        x:Class="MicaWPF.DesktopApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MicaWPF.DesktopApp"
        mc:Ignorable="d"
        Title="MainWindow" 
        Height="450" 
        Width="800"
        ChangeTitleColorWhenInactive="False"
        xmlns:mica="clr-namespace:MicaWPF.Controls;assembly=MicaWPF" >
    <Grid>

    </Grid>
</mica:MicaWindow>

TitleBarContent

The TitleBarContent property let you add controls in the titlebar

Usage Exemple:
<mica:MicaWindow.TitleBarContent>
    <StackPanel Orientation="Horizontal">
        <TextBlock VerticalAlignment="Center">Hello From the TitleBar!</TextBlock>
        <controls:MicaButton Margin="5,0,0,0" Content="TitleBar Button!" />
    </StackPanel>
</mica:MicaWindow.TitleBarContent>
Results:

image

TitleBarType

The TitleBarType property let you switch between a Win32 (Default) or WinUI styled TitleBar.

Usage Exemple:
<mica:MicaWindow  
        x:Class="MicaWPF.DesktopApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
       xmlns:mica="clr-namespace:MicaWPF.Controls;assembly=MicaWPF" 
        mc:Ignorable="d"
        Title="MainWindow" 
        Height="450" 
        Width="800"
        TitleBarType="WinUI">
    <Grid>

    </Grid>
</mica:MicaWindow>
Results:
TitleBarType="Win32"  

image

TitleBarType="WinUI" <!-- This is the default one --> 

image