Added Minimize/Maximize/Close Buttons and took WindowStyle
This commit is contained in:
@@ -13,6 +13,9 @@ public class MainWindowViewModel : ViewModelBase
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
DisplaySplitEvent = new RelayCommand(DisplaySplit);
|
||||
CloseAppEvent = new RelayCommand(CloseApp);
|
||||
MaximizeAppEvent = new RelayCommand(MaximizeApp);
|
||||
MinimizeAppEvent = new RelayCommand(MinimizeApp);
|
||||
|
||||
ColorPalette =
|
||||
[
|
||||
|
||||
@@ -74,4 +74,33 @@ public class ViewModelBase : ObservableObject
|
||||
{
|
||||
IsSplitOpen = !IsSplitOpen;
|
||||
}
|
||||
|
||||
private WindowState _windowStateProperty;
|
||||
|
||||
public WindowState WindowStateProperty
|
||||
{
|
||||
get => _windowStateProperty;
|
||||
set => SetProperty(ref _windowStateProperty, value);
|
||||
}
|
||||
|
||||
public IRelayCommand CloseAppEvent { get; protected set; }
|
||||
|
||||
protected void CloseApp()
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
public IRelayCommand MaximizeAppEvent { get; protected set; }
|
||||
|
||||
protected void MaximizeApp()
|
||||
{
|
||||
WindowStateProperty = WindowState.Maximized;
|
||||
}
|
||||
|
||||
public IRelayCommand MinimizeAppEvent { get; protected set; }
|
||||
|
||||
protected void MinimizeApp()
|
||||
{
|
||||
WindowStateProperty = WindowState.Minimized;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user