diff --git a/src/settings-ui/Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs b/src/settings-ui/Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs index 2f01dc502c48..2c8e555b73fc 100644 --- a/src/settings-ui/Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs +++ b/src/settings-ui/Settings.UI.Library/ViewModels/PowerLauncherViewModel.cs @@ -94,11 +94,6 @@ public PowerLauncherViewModel(PowerLauncherSettings settings, ISettingsRepositor break; } - foreach (var plugin in Plugins) - { - plugin.PropertyChanged += OnPluginInfoChange; - } - SearchPluginsCommand = new RelayCommand(SearchPlugins); } @@ -412,6 +407,10 @@ public ObservableCollection Plugins if (_plugins == null) { _plugins = new ObservableCollection(settings.Plugins.Select(x => new PowerLauncherPluginViewModel(x, isDark))); + foreach (var plugin in Plugins) + { + plugin.PropertyChanged += OnPluginInfoChange; + } } return _plugins; @@ -420,7 +419,7 @@ public ObservableCollection Plugins public bool ShowAllPluginsDisabledWarning { - get => EnablePowerLauncher && Plugins.Any() && Plugins.All(x => x.Disabled); + get => EnablePowerLauncher && settings.Plugins.Any() && settings.Plugins.All(x => x.Disabled); } public bool ShowPluginsLoadingMessage