more design

This commit is contained in:
Vova
2024-01-21 17:39:07 +02:00
parent e36554eeab
commit 7d00619d14
9 changed files with 271 additions and 20 deletions
+40 -2
View File
@@ -1,4 +1,5 @@
using CommunityToolkit.Mvvm.Input;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -14,7 +15,8 @@ namespace TV_Player
}
private bool _isTopPanelVisible;
public bool IsTopPanelVisible{
public bool IsTopPanelVisible
{
get => _isTopPanelVisible;
set => SetProperty(ref _isTopPanelVisible, value);
}
@@ -26,15 +28,51 @@ namespace TV_Player
set => SetProperty(ref _topPaneTitle, value);
}
private WindowState _currentWindowState;
public WindowState CurrentWindowState
{
get => _currentWindowState;
set => SetProperty(ref _currentWindowState, value);
}
private WindowStyle _currentWindowStyle;
public WindowStyle CurrentWindowStyle
{
get => _currentWindowStyle;
set => SetProperty(ref _currentWindowStyle, value);
}
public ICommand FullscreenCommand { get; }
public Action ButtonBackAction { get; set; }
public ICommand BackCommand { get; }
public MainViewModel()
{
{
BackCommand = new RelayCommand(OnButtonBackClick);
FullscreenCommand = new RelayCommand(OnFullSctreenButtonClick);
CurrentWindowStyle = WindowStyle.SingleBorderWindow;
}
private void OnFullSctreenButtonClick()
{
if (CurrentWindowStyle == WindowStyle.SingleBorderWindow)
{
CurrentWindowStyle = WindowStyle.None;
CurrentWindowState = WindowState.Maximized;
}
else
{
CurrentWindowStyle = WindowStyle.SingleBorderWindow;
CurrentWindowState = WindowState.Normal;
}
}
private void OnButtonBackClick()
{
ButtonBackAction?.Invoke();
}
}