简体   繁体   English

UWP FolderPicker - 显示以父级为中心的对话窗口

[英]UWP FolderPicker - show the dialog window centered over parent

In a button click handler I am showing a FolderPicker dialog using the following piece of code:在按钮单击处理程序中,我使用以下代码显示FolderPicker对话框:

 var folderPicker = new FolderPicker();            
 folderPicker.SuggestedStartLocation = PickerLocationId.Desktop;
 folderPicker.FileTypeFilter.Add("*");
 StorageFolder folder = await folderPicker.PickSingleFolderAsync();

The dialog window is shown in the upper left corner of the screen.对话窗口显示在屏幕的左上角。 I would like the window to appear centered over the parent window.我希望窗口出现在父窗口的中心。 How do I do that?我怎么做?

show the dialog window centered over parent显示以父级为中心的对话窗口

Currently, UWP FolderPicker does not provide api that specific the dialog window's location, And FolderPicker was handled by Runtime broker that is system level, in other words, the dialog will set it's location base on the uwp app window's position.目前,UWP FolderPicker不提供特定对话框窗口位置的 api,并且 FolderPicker 由系统级别的运行时代理处理,换句话说,对话框将根据 uwp 应用程序窗口的位置设置其位置。 If you do want this feature, please feel free post your requirement with windows feed back hub app.如果您确实需要此功能,请随时使用 Windows 反馈中心应用发布您的要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM