To achieve window transparency, you need to set the following
WindowStartupLocation="CenterScreen"
AllowsTransparency ="True"
WindowStyle="None"
Background="Transparent"
Maximize, minimize, and close can be achieved by yourself:
XAML:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Rectangle Fill="Brown" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"></Rectangle>
<WrapPanel HorizontalAlignment="Right" VerticalAlignment="Top" Height="30" Width="Auto">
<Button Width="20" Height="20" Margin="5" Click="Button_Click_1">_</Button>
<Button Width="20" Height="20" Margin="5" Click="Button_Click_2">口</Button>
<Button Width="20" Height="20" Margin="5" Click="Button_Click_3">X</Button>
</WrapPanel>
</Grid>
Code:
private void Button_Click_1(object sender, RoutedEventArgs e)
{
if (this.WindowState != WindowState.Minimized)
{
this.WindowState = WindowState.Minimized;
}
}
private void Button_Click_2(object sender, RoutedEventArgs e)
{
if (this.WindowState != WindowState.Maximized)
{
this.WindowState = WindowState.Normal;
}
}
private void Button_Click_3(object sender, RoutedEventArgs e)
{
this.Close();
}
private void Rectangle_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
this.DragMove();
}