Browse Source

use `[ObservableProperty]` syntax in the settings window to simplify it

Daniel Chalmers 1 month ago
parent
commit
b8fc8b192c
1 changed files with 3 additions and 12 deletions
  1. 3 12
      DesktopClock/SettingsWindow.xaml.cs

+ 3 - 12
DesktopClock/SettingsWindow.xaml.cs

@@ -230,7 +230,10 @@ public partial class SettingsWindowViewModel : ObservableObject, IDisposable
 {
     private readonly SystemClockTimer _systemClockTimer;
 
+    [ObservableProperty]
     private string _previewTimeText;
+
+    [ObservableProperty]
     private string _previewCountdownText;
 
     public Settings Settings { get; }
@@ -264,18 +267,6 @@ public partial class SettingsWindowViewModel : ObservableObject, IDisposable
 
     public IList<TimeZoneInfo> TimeZones { get; }
 
-    public string PreviewTimeText
-    {
-        get => _previewTimeText;
-        private set => SetProperty(ref _previewTimeText, value);
-    }
-
-    public string PreviewCountdownText
-    {
-        get => _previewCountdownText;
-        private set => SetProperty(ref _previewCountdownText, value);
-    }
-
     [RelayCommand]
     public void SetFormat(DateFormatExample value)
     {