using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using Avalonia.Input; using Avalonia.Media; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using SimpleDraw.Models; namespace SimpleDraw.ViewModels; public class ViewModelBase : ObservableObject { public int WindowWidth { get; set; } = 1200; public int WindowHeight { get; set; } = 800; public ObservableCollection? ColorPalette { get; set; } public IRelayCommand? CanvasPointerPressedCommand { get; set; } public IRelayCommand? CanvasPointerMovedCommand { get; set; } public IRelayCommand? CanvasPointerReleasedCommand { get; set; } public ObservableCollection DrawingPoints { get; set; } = new(); public DrawingPoints? DrawingPoint { get; set; } protected bool IsDrawing { get; set; } private Brush _brush = new SolidColorBrush(new Color(a: 255, r: 0, g: 0, b: 0)); private double _brushThickness = 2.0; protected Brush Brush { get => _brush; set => SetProperty(ref _brush, value); } public double BrushThickness { get => _brushThickness; set => SetProperty(ref _brushThickness, value); } }