feat: disable titlebar double tap event when CanResize is false.

This commit is contained in:
rabbitism
2024-08-13 23:04:43 +08:00
parent b07383e499
commit e34137daea

View File

@@ -63,22 +63,10 @@ public class TitleBar: ContentControl
private void OnDoubleTapped(object? sender, TappedEventArgs e)
{
if (_visualRoot is not null)
{
if ( _visualRoot.WindowState == WindowState.FullScreen)
{
return;
}
if (_visualRoot.WindowState == WindowState.Maximized)
{
_visualRoot.WindowState = WindowState.Normal;
}
else
{
_visualRoot.WindowState = WindowState.Maximized;
}
}
if (_visualRoot is null) return;
if (!_visualRoot.CanResize) return;
if ( _visualRoot.WindowState == WindowState.FullScreen) return;
_visualRoot.WindowState = _visualRoot.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
}
private void UpdateSize(Window window)