diff --git a/Models/DrawingPoints.cs b/Models/DrawingPoints.cs index a8479e5..375b3f3 100644 --- a/Models/DrawingPoints.cs +++ b/Models/DrawingPoints.cs @@ -8,7 +8,6 @@ namespace SimpleDraw.Models; public class DrawingPoints : ObservableObject { private ObservableCollection _drawingPoints = new ObservableCollection(); - // private ObservableCollection> _drawingPointsList = new ObservableCollection>(); private Brush _brush; private double _brushThickness; @@ -36,12 +35,4 @@ public class DrawingPoints : ObservableObject Brush = brush; BrushThickness = brushThickness; } - - /* - public ObservableCollection> DrawingPointsList - { - get => _drawingPointsList; - set => SetProperty(ref _drawingPointsList, value); - } - */ } \ No newline at end of file diff --git a/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs index c48b609..d46931a 100644 --- a/ViewModels/MainWindowViewModel.cs +++ b/ViewModels/MainWindowViewModel.cs @@ -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 = [ diff --git a/ViewModels/ViewModelBase.cs b/ViewModels/ViewModelBase.cs index e063dc0..3deef04 100644 --- a/ViewModels/ViewModelBase.cs +++ b/ViewModels/ViewModelBase.cs @@ -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; + } } diff --git a/Views/MainWindow.axaml b/Views/MainWindow.axaml index 8ca141b..8768e13 100644 --- a/Views/MainWindow.axaml +++ b/Views/MainWindow.axaml @@ -18,6 +18,9 @@ Title="SimpleDraw" Width="{Binding WindowWidth}" Height="{Binding WindowHeight}" + WindowState="{Binding WindowStateProperty, Mode=TwoWay}" + SystemDecorations="None" + ExtendClientAreaToDecorationsHint="True" MinWidth="400" MinHeight="300" WindowStartupLocation="CenterScreen" @@ -39,28 +42,13 @@ - + - - - - - - - - - - - - - - - - - + + @@ -82,11 +70,14 @@ - + + + + Brush Size: - + @@ -144,7 +135,18 @@ - + + + + + + + + + +