add close button

This commit is contained in:
Vova
2024-05-05 16:19:58 +03:00
parent 3dfeea71f0
commit 12289c52f8
20 changed files with 327 additions and 191 deletions
+8 -12
View File
@@ -37,14 +37,8 @@ namespace TV_Player
set => SetProperty(ref _currentWindowState, value);
}
private WindowStyle _currentWindowStyle;
public WindowStyle CurrentWindowStyle
{
get => _currentWindowStyle;
set => SetProperty(ref _currentWindowStyle, value);
}
public ICommand FullscreenCommand { get; }
public ICommand CloseAppCommand { get; }
public Action ButtonBackAction { get; set; }
public ICommand BackCommand { get; }
@@ -57,24 +51,26 @@ namespace TV_Player
BackCommand = new RelayCommand(OnButtonBackClick);
FullscreenCommand = new RelayCommand(OnFullSctreenButtonClick);
SettingsCommand = new RelayCommand(OnSettingsButtonClick);
CurrentWindowStyle = WindowStyle.SingleBorderWindow;
CloseAppCommand = new RelayCommand(OnCloseAppButtonClick);
}
public void OnFullSctreenButtonClick()
{
if (CurrentWindowStyle == WindowStyle.SingleBorderWindow)
if (CurrentWindowState == WindowState.Normal)
{
CurrentWindowStyle = WindowStyle.None;
CurrentWindowState = WindowState.Maximized;
}
else
{
CurrentWindowStyle = WindowStyle.SingleBorderWindow;
CurrentWindowState = WindowState.Normal;
}
}
private void OnCloseAppButtonClick()
{
Environment.Exit(0);
}
private void OnButtonBackClick()
{