UWP C#调整contentdialog的大小 [英] UWP C# resize contentdialog

查看:245
本文介绍了UWP C#调整contentdialog的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的解决方案播放视频,并允许用户点击按钮,因为视频播放录制不同的统计信息。统计信息存储在List< class>中。在播放之后和更新SQLite Db之前,每个stat都会在ContentDialog框中打开,询问播放器。玩家在ContentDialog上的GridView中,用户只需双击玩家,并将统计信息添加到新列表中。所有这一切都很好,但ContentDialog框不足以在GridView充满所有玩家后托管GridView。有没有办法调整此控件的大小?如果没有,有没有办法创建一个将打开异步的新页面/框架。我从foreach循环调用ContentDialog并等待返回更新列表。



我尝试过:



我试图将ContentDialog更改为UserControl,但我无法将其称为异步,这是关键,因为它在foreach循环中被调用以附加每个列表项与播放器。我只是使用



My solution plays a video and allows the user to click buttons as the video plays recording different statistics. The stats are stored in a List<class>. After a the play and before updating the SQLite Db each stat opens in the ContentDialog box asking for the player. The players are in a GridView on the ContentDialog and the user simply double taps the player and the stat is added to a new list. All of this works fine, but the ContentDialog box is not big enough to host the GridView once it is filled with all of the players. Is there a way to resize this control? If not, is there a way to create a new page/frame that will open async. I call the ContentDialog from a foreach loop and it awaits the return to update the list.

What I have tried:

I tried to change the ContentDialog to a UserControl but I couldn't call it async and this is the key as it is called in the foreach loop to append each list item with the player. I simply use

UserControls.PlayerDG playerDG = new UserControls.PlayerDG();
await playerDG.ShowAsync();

推荐答案

通过一些研究,我发现了一个适合我的解决方案。 ContentDialog在功能上完全符合我的要求,我现在知道它可以用来调用UserControl。虽然,窗口大小似乎确实有限,因为我必须改变我的控件的布局,使一切都适合。这种方式似乎给了我更多的房地产。下面是使用contentDialog显示用户控件的代码



With a little more research I found a solution that works for me. The ContentDialog functionally does exactly what I want and I know now it can be used to call a UserControl. Although, the window size does seem to be limited as I had to alter the layout of my control to make everything fit. This way does seem to give me more real estate to work with. Below is the code to use the contentDialog to display a usercontrol

D = new ContentDialog
     {
          Title = GL.Qst + "?",
          Content = new PlayerSelUC()
     };

     await D.ShowAsync();


这篇关于UWP C#调整contentdialog的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆