Skip to content

Commit

Permalink
Fix: Fixed issue where the back button in the Properties window wasn'…
Browse files Browse the repository at this point in the history
…t working properly (files-community#13162)
  • Loading branch information
hishitetsu authored Aug 9, 2023
1 parent 7f52809 commit beae745
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public NavigationViewItemButtonStyleItem SelectedNavigationViewItem
set
{
if (SetProperty(ref _SelectedNavigationViewItem, value) &&
!_selectionChangedAutomatically &&
_previousPageName != value.ItemType.ToString())
!_selectionChangedAutomatically)
{
var parameter = new PropertiesPageNavigationParameter()
{
Expand Down Expand Up @@ -90,8 +89,6 @@ public NavigationViewItemButtonStyleItem SelectedNavigationViewItem

private bool _selectionChangedAutomatically { get; set; }

private string _previousPageName { get; set; }

public IRelayCommand DoBackwardNavigationCommand { get; }
public IAsyncRelayCommand SaveChangedPropertiesCommand { get; }
public IRelayCommand CancelChangedPropertiesCommand { get; }
Expand Down Expand Up @@ -127,12 +124,12 @@ private void ExecuteDoBackwardNavigationCommand()
var pageTag = ((Page)_mainFrame.Content).Tag.ToString();

_selectionChangedAutomatically = true;
_previousPageName = pageTag;

// Move selection indicator
SelectedNavigationViewItem =
_SelectedNavigationViewItem =
NavigationViewItems.First(x => string.Equals(x.ItemType.ToString(), pageTag, StringComparison.CurrentCultureIgnoreCase))
?? NavigationViewItems.First();
OnPropertyChanged(nameof(SelectedNavigationViewItem));
}

private async Task ExecuteSaveChangedPropertiesCommand()
Expand Down

0 comments on commit beae745

Please sign in to comment.