From 548435b4fde5c7843367803c549472393a7bdf5f Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 17 Jun 2025 16:58:48 +0800 Subject: [PATCH] Improve code quality --- ...low.Launcher.Plugin.BrowserBookmark.csproj | 35 ++----------------- .../Views/SettingsControl.xaml.cs | 11 +++--- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 49ae26564..1211cdf18 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -37,41 +37,11 @@ - + - + @@ -95,6 +65,7 @@ + diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs index 3182adfed..1ee6b5c45 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs @@ -1,12 +1,13 @@ using System.Windows; -using Flow.Launcher.Plugin.BrowserBookmark.Models; using System.Windows.Input; -using System.ComponentModel; using System.Threading.Tasks; +using CommunityToolkit.Mvvm.ComponentModel; +using Flow.Launcher.Plugin.BrowserBookmark.Models; namespace Flow.Launcher.Plugin.BrowserBookmark.Views; -public partial class SettingsControl : INotifyPropertyChanged +[INotifyPropertyChanged] +public partial class SettingsControl { public Settings Settings { get; } public CustomBrowser SelectedCustomBrowser { get; set; } @@ -53,12 +54,10 @@ public partial class SettingsControl : INotifyPropertyChanged set { Settings.OpenInNewBrowserWindow = value; - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(OpenInNewBrowserWindow))); + OnPropertyChanged(); } } - public event PropertyChangedEventHandler PropertyChanged; - private void NewCustomBrowser(object sender, RoutedEventArgs e) { var newBrowser = new CustomBrowser();