Skip to content
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 Files/Interacts/Interaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,12 @@ private async Task OpenPropertiesWindow(object item)
{
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
{

AppWindow appWindow = await AppWindow.TryCreateAsync();
Frame frame = new Frame();
appWindow.TitleBar.ExtendsContentIntoTitleBar = true;
frame.Navigate(typeof(Properties), item, new SuppressNavigationTransitionInfo());

WindowManagementPreview.SetPreferredMinSize(appWindow, new Size(400, 500));

appWindow.RequestSize(new Size(400, 475));
Expand Down
2 changes: 1 addition & 1 deletion Files/Views/Pages/Properties.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Loaded="Properties_Loaded"
RequestedTheme="{x:Bind local1:ThemeHelper.RootTheme}"
Unloaded="Properties_Unloaded"
mc:Ignorable="d">
mc:Ignorable="d" KeyDown="Page_KeyDown">
<Page.Background>
<AcrylicBrush
Windows10version1903:TintLuminosityOpacity="0.9"
Expand Down
10 changes: 10 additions & 0 deletions Files/Views/Pages/Properties.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
using System.Threading;
using Windows.Foundation.Metadata;
using Windows.Storage;
using Windows.System;
using Windows.UI;
using Windows.UI.WindowManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Navigation;

namespace Files
Expand Down Expand Up @@ -131,5 +133,13 @@ private async void Button_Click(object sender, RoutedEventArgs e)
propertiesDialog.Hide();
}
}

async void Page_KeyDown(object sender, KeyRoutedEventArgs e)
{
if (e.Key.Equals(VirtualKey.Escape) && ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
{
await propWindow.CloseAsync();
}
}
}
}