From b7d2f1897a7480eedf899dd581950332b3db91ee Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Sat, 10 Feb 2024 01:20:13 +0900 Subject: [PATCH] Fix: Fixed NullReferenceException in InvertSelectionAction (#14681) --- .../Content/Selection/InvertSelectionAction.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/Files.App/Actions/Content/Selection/InvertSelectionAction.cs b/src/Files.App/Actions/Content/Selection/InvertSelectionAction.cs index 2cabaf47b25a..446bf8f53304 100644 --- a/src/Files.App/Actions/Content/Selection/InvertSelectionAction.cs +++ b/src/Files.App/Actions/Content/Selection/InvertSelectionAction.cs @@ -3,7 +3,7 @@ namespace Files.App.Actions { - internal class InvertSelectionAction : ObservableObject, IAction + internal class InvertSelectionAction : IAction { private readonly IContentPageContext context; @@ -41,8 +41,6 @@ public bool IsExecutable public InvertSelectionAction() { context = Ioc.Default.GetRequiredService(); - - context.PropertyChanged += Context_PropertyChanged; } public Task ExecuteAsync() @@ -51,17 +49,5 @@ public Task ExecuteAsync() return Task.CompletedTask; } - - private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - switch (e.PropertyName) - { - case nameof(IContentPageContext.PageType): - case nameof(IContentPageContext.HasItem): - case nameof(IContentPageContext.ShellPage): - OnPropertyChanged(nameof(IsExecutable)); - break; - } - } } }