-
-
Notifications
You must be signed in to change notification settings - Fork 11
MicaWindow Properties
Simnico99 edited this page Jul 14, 2023
·
11 revisions
Table of Contents
The SystemBackdropType
property will dictate how the background of the window will behave see results to see the type available.
<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>
SystemBackdropType="Mica" <!-- This is the default one -->
SystemBackdropType="Tabbed"
SystemBackdropType="Acrylic"
SystemBackdropType="None"
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.
<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>
The ChangeTitleColorWhenInactive
property changes if the text Titlebar text will change color when the Window is inactive.
<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>
The TitleBarContent
property let you add controls in the titlebar
<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>
The TitleBarType
property let you switch between a Win32 (Default) or WinUI styled TitleBar.
<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>
TitleBarType="Win32"
TitleBarType="WinUI" <!-- This is the default one -->
The documentation is maintained by @Simnico99. This Library is distributed under an MIT License.