Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed issue where the properties window opened from BaseContextMenuFlyout was hidden #11761

Merged
merged 1 commit into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Files.App/IBaseLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ public interface IBaseLayout : IDisposable
public BaseLayoutCommandsViewModel? CommandsViewModel { get; }

public CommandBarFlyout ItemContextMenuFlyout { get; set; }

public CommandBarFlyout BaseContextMenuFlyout { get; set; }
}
}
14 changes: 11 additions & 3 deletions src/Files.App/Interacts/BaseLayoutCommandImplementationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,22 @@ public virtual void OpenItem(RoutedEventArgs e)
public virtual void ShowProperties(RoutedEventArgs e)
{
if (SlimContentPage.ItemContextMenuFlyout.IsOpen)
SlimContentPage.ItemContextMenuFlyout.Closed += OpenProperties;
SlimContentPage.ItemContextMenuFlyout.Closed += OpenPropertiesFromItemContextMenuFlyout;
else if (SlimContentPage.BaseContextMenuFlyout.IsOpen)
SlimContentPage.BaseContextMenuFlyout.Closed += OpenPropertiesFromBaseContextMenuFlyout;
else
FilePropertiesHelpers.ShowProperties(associatedInstance);
}

private void OpenProperties(object sender, object e)
private void OpenPropertiesFromItemContextMenuFlyout(object sender, object e)
{
SlimContentPage.ItemContextMenuFlyout.Closed -= OpenProperties;
SlimContentPage.ItemContextMenuFlyout.Closed -= OpenPropertiesFromItemContextMenuFlyout;
FilePropertiesHelpers.ShowProperties(associatedInstance);
}

private void OpenPropertiesFromBaseContextMenuFlyout(object sender, object e)
{
SlimContentPage.BaseContextMenuFlyout.Closed -= OpenPropertiesFromBaseContextMenuFlyout;
FilePropertiesHelpers.ShowProperties(associatedInstance);
}

Expand Down