Przeglądaj źródła

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

Daniel Chalmers 1 miesiąc temu
rodzic
commit
b8fc8b192c
1 zmienionych plików z 3 dodań i 12 usunięć
  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;
     private readonly SystemClockTimer _systemClockTimer;
 
 
+    [ObservableProperty]
     private string _previewTimeText;
     private string _previewTimeText;
+
+    [ObservableProperty]
     private string _previewCountdownText;
     private string _previewCountdownText;
 
 
     public Settings Settings { get; }
     public Settings Settings { get; }
@@ -264,18 +267,6 @@ public partial class SettingsWindowViewModel : ObservableObject, IDisposable
 
 
     public IList<TimeZoneInfo> TimeZones { get; }
     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]
     [RelayCommand]
     public void SetFormat(DateFormatExample value)
     public void SetFormat(DateFormatExample value)
     {
     {