File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/Files.App/Actions/Content/Selection Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 3
3
4
4
namespace Files . App . Actions
5
5
{
6
- internal class InvertSelectionAction : IAction
6
+ internal class InvertSelectionAction : ObservableObject , IAction
7
7
{
8
8
private readonly IContentPageContext context ;
9
9
@@ -41,6 +41,8 @@ public bool IsExecutable
41
41
public InvertSelectionAction ( )
42
42
{
43
43
context = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
44
+
45
+ context . PropertyChanged += Context_PropertyChanged ;
44
46
}
45
47
46
48
public Task ExecuteAsync ( )
@@ -49,5 +51,17 @@ public Task ExecuteAsync()
49
51
50
52
return Task . CompletedTask ;
51
53
}
54
+
55
+ private void Context_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
56
+ {
57
+ switch ( e . PropertyName )
58
+ {
59
+ case nameof ( IContentPageContext . PageType ) :
60
+ case nameof ( IContentPageContext . HasItem ) :
61
+ case nameof ( IContentPageContext . ShellPage ) :
62
+ OnPropertyChanged ( nameof ( IsExecutable ) ) ;
63
+ break ;
64
+ }
65
+ }
52
66
}
53
67
}
You can’t perform that action at this time.
0 commit comments