Skip to content

Commit 2351716

Browse files
authored
Fix: Fixed issue where the properties window opened from BaseContextMenuFlyout was hidden (#11761)
1 parent fa2664a commit 2351716

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/Files.App/IBaseLayout.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ public interface IBaseLayout : IDisposable
3030
public BaseLayoutCommandsViewModel? CommandsViewModel { get; }
3131

3232
public CommandBarFlyout ItemContextMenuFlyout { get; set; }
33+
34+
public CommandBarFlyout BaseContextMenuFlyout { get; set; }
3335
}
3436
}

src/Files.App/Interacts/BaseLayoutCommandImplementationModel.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,22 @@ public virtual void OpenItem(RoutedEventArgs e)
9393
public virtual void ShowProperties(RoutedEventArgs e)
9494
{
9595
if (SlimContentPage.ItemContextMenuFlyout.IsOpen)
96-
SlimContentPage.ItemContextMenuFlyout.Closed += OpenProperties;
96+
SlimContentPage.ItemContextMenuFlyout.Closed += OpenPropertiesFromItemContextMenuFlyout;
97+
else if (SlimContentPage.BaseContextMenuFlyout.IsOpen)
98+
SlimContentPage.BaseContextMenuFlyout.Closed += OpenPropertiesFromBaseContextMenuFlyout;
9799
else
98100
FilePropertiesHelpers.ShowProperties(associatedInstance);
99101
}
100102

101-
private void OpenProperties(object sender, object e)
103+
private void OpenPropertiesFromItemContextMenuFlyout(object sender, object e)
102104
{
103-
SlimContentPage.ItemContextMenuFlyout.Closed -= OpenProperties;
105+
SlimContentPage.ItemContextMenuFlyout.Closed -= OpenPropertiesFromItemContextMenuFlyout;
106+
FilePropertiesHelpers.ShowProperties(associatedInstance);
107+
}
108+
109+
private void OpenPropertiesFromBaseContextMenuFlyout(object sender, object e)
110+
{
111+
SlimContentPage.BaseContextMenuFlyout.Closed -= OpenPropertiesFromBaseContextMenuFlyout;
104112
FilePropertiesHelpers.ShowProperties(associatedInstance);
105113
}
106114

0 commit comments

Comments
 (0)