Skip to content

Commit

Permalink
Add better window maximized function + new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Triky313 committed Jan 25, 2020
1 parent 9c19c67 commit 1dbaeb4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
28 changes: 27 additions & 1 deletion StatisticsAnalysisTool/StatisticsAnalysisTool/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,33 @@ private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
if (e.ClickCount == 2 && WindowState == WindowState.Maximized) WindowState = WindowState.Normal;
}

private void MaximizedButton_Click(object sender, RoutedEventArgs e) => WindowState = (WindowState == WindowState.Normal) ? WindowState.Maximized : WindowState.Normal;
private static Rect _storedSize;
private static bool _isWindowMaximized;

private void MaximizedButton_Click(object sender, RoutedEventArgs e)
{
if (_isWindowMaximized)
{
Left = _storedSize.Left;
Top = _storedSize.Top;
Height = _storedSize.Height;
Width = _storedSize.Width;
CenterWindowOnScreen();
MaximizedButton.Content = 1;
_isWindowMaximized = false;
}
else
{
_storedSize.Width = Width;
_storedSize.Height = Height;
Left = SystemParameters.WorkArea.Left;
Top = SystemParameters.WorkArea.Top;
Height = SystemParameters.WorkArea.Height;
Width = SystemParameters.WorkArea.Width;
MaximizedButton.Content = 2;
_isWindowMaximized = true;
}
}

private void CbMode_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.1.*")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: AssemblyVersion("1.2.2.*")]
[assembly: AssemblyFileVersion("1.2.2.0")]

0 comments on commit 1dbaeb4

Please sign in to comment.