Skip to content

Commit beae745

Browse files
authored
Fix: Fixed issue where the back button in the Properties window wasn't working properly (#13162)
1 parent 7f52809 commit beae745

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Files.App/ViewModels/Properties/MainPropertiesViewModel.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public NavigationViewItemButtonStyleItem SelectedNavigationViewItem
2222
set
2323
{
2424
if (SetProperty(ref _SelectedNavigationViewItem, value) &&
25-
!_selectionChangedAutomatically &&
26-
_previousPageName != value.ItemType.ToString())
25+
!_selectionChangedAutomatically)
2726
{
2827
var parameter = new PropertiesPageNavigationParameter()
2928
{
@@ -90,8 +89,6 @@ public NavigationViewItemButtonStyleItem SelectedNavigationViewItem
9089

9190
private bool _selectionChangedAutomatically { get; set; }
9291

93-
private string _previousPageName { get; set; }
94-
9592
public IRelayCommand DoBackwardNavigationCommand { get; }
9693
public IAsyncRelayCommand SaveChangedPropertiesCommand { get; }
9794
public IRelayCommand CancelChangedPropertiesCommand { get; }
@@ -127,12 +124,12 @@ private void ExecuteDoBackwardNavigationCommand()
127124
var pageTag = ((Page)_mainFrame.Content).Tag.ToString();
128125

129126
_selectionChangedAutomatically = true;
130-
_previousPageName = pageTag;
131127

132128
// Move selection indicator
133-
SelectedNavigationViewItem =
129+
_SelectedNavigationViewItem =
134130
NavigationViewItems.First(x => string.Equals(x.ItemType.ToString(), pageTag, StringComparison.CurrentCultureIgnoreCase))
135131
?? NavigationViewItems.First();
132+
OnPropertyChanged(nameof(SelectedNavigationViewItem));
136133
}
137134

138135
private async Task ExecuteSaveChangedPropertiesCommand()

0 commit comments

Comments
 (0)