0
I left the WindowStyle="None"
and that eliminates all the animation of the window.
A normal window edged has the excitement of fading to the (minimize, maximize and close).
I wish that same effect existed in a windowless.
That’s the XAML
with ready interface.
<Window x:Class="my_project_test.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"
AllowsTransparency="True"
WindowStyle="None"
Height="700"
Width="1080"
xmlns:local="clr-namespace:my_project_test"
mc:Ignorable="d"
Title="MainWindow">
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.ColumnSpan="4" Background="Black" MouseLeftButtonDown="DragMove_Click"></StackPanel>
<Button Grid.Column="1" Margin="2" Content="minimize" Click="ButtonMinimize_Click"></Button>
<Button Grid.Column="2" Margin="2" Content="maximize" Click="ButtonMaximize_Click"></Button>
<Button Grid.Column="3" Margin="2" Content="close" Click="ButtonClose_Click"></Button>
</Grid>
</Grid>
</Window>
Complete code:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
this.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
}
private void ButtonMinimize_Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}
private void ButtonMaximize_Click(object sender, RoutedEventArgs e)
{
if (this.WindowState != WindowState.Maximized) this.WindowState = WindowState.Maximized;
else this.WindowState = WindowState.Normal;
}
private void ButtonClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void DragMove_Click(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
}
As you can see, the window has no animation when clicking on any of the 3 button
above.
How can I cheer up that window to (maximize, minimize and close), using the 3 buttons
above?