Skip to content

Commit 2405b73

Browse files
authored
Fix "+" button state on toolbar (#1791)
1 parent 4ef6aeb commit 2405b73

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

Files/View Models/CurrentInstanceViewModel.cs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,41 @@ public class CurrentInstanceViewModel : ObservableObject
99
public bool IsPageTypeNotHome
1010
{
1111
get => _IsPageTypeNotHome;
12-
set => SetProperty(ref _IsPageTypeNotHome, value);
12+
set
13+
{
14+
SetProperty(ref _IsPageTypeNotHome, value);
15+
OnPropertyChanged(nameof(IsCreateButtonEnabledInPage));
16+
OnPropertyChanged(nameof(CanCreateFileInPage));
17+
OnPropertyChanged(nameof(CanOpenTerminalInPage));
18+
}
1319
}
1420

1521
private bool _IsPageTypeMtpDevice = false;
1622

1723
public bool IsPageTypeMtpDevice
1824
{
1925
get => _IsPageTypeMtpDevice;
20-
set => SetProperty(ref _IsPageTypeMtpDevice, value);
26+
set
27+
{
28+
SetProperty(ref _IsPageTypeMtpDevice, value);
29+
OnPropertyChanged(nameof(IsCreateButtonEnabledInPage));
30+
OnPropertyChanged(nameof(CanCreateFileInPage));
31+
OnPropertyChanged(nameof(CanOpenTerminalInPage));
32+
}
2133
}
2234

2335
private bool _IsPageTypeRecycleBin = false;
2436

2537
public bool IsPageTypeRecycleBin
2638
{
2739
get => _IsPageTypeRecycleBin;
28-
set => SetProperty(ref _IsPageTypeRecycleBin, value);
40+
set
41+
{
42+
SetProperty(ref _IsPageTypeRecycleBin, value);
43+
OnPropertyChanged(nameof(IsCreateButtonEnabledInPage));
44+
OnPropertyChanged(nameof(CanCreateFileInPage));
45+
OnPropertyChanged(nameof(CanOpenTerminalInPage));
46+
}
2947
}
3048

3149
public bool IsCreateButtonEnabledInPage

0 commit comments

Comments
 (0)