A reusable, simple flat window control for WPF
Screenshot:
Usage:
Install-Package FlatWindow
Add a new Window to your project, then remove the inheritance (: Window
) in the .cs file and replace the XAML. The files should look like this:
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
}
<simply:FlatWindow x:Class="WindowTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:simply="clr-namespace:Simply;assembly=FlatWindow"
Title="My Flat Window" Height="250" Width="450">
<Grid>
<TextBlock Text="Here goes the content!"/>
</Grid>
</simply:FlatWindow>
cheers!
Customize:
Add Brushes with the Keys "WindowBackground" and "CaptionColor" to your window resource dictionary
<SolidColorBrush x:Key="WindowBackground" Color="Black" />
<SolidColorBrush x:Key="CaptionColor" Color="White" />
<Style x:Key="CaptionStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
</Style>
Credit:
- The guys at Microsoft for their WPF Shell Integration Library, especially LesterLobo for his Article
- Silberfab: BorderLess Window on CodePlex
- Magnus Montin: Article on his blog