UWP对话框中的图像类似于使用C#
我试过飞出:UWP对话框中的图像类似于使用C#,c#,windows,uwp,windows-10-universal,C#,Windows,Uwp,Windows 10 Universal,我试过飞出: <AppBarButton Label="About Us" Tapped="appbarButton_Click"> <AppBarButton.Icon> <BitmapIcon UriSource="ms-appx:///Assets/Icons/info.png"/> </AppBarButton.Icon> <AppBarButton.Flyout> <
<AppBarButton Label="About Us" Tapped="appbarButton_Click">
<AppBarButton.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/Icons/info.png"/>
</AppBarButton.Icon>
<AppBarButton.Flyout>
<Flyout >
<TextBlock Text="Hello User" HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
</Flyout>
</AppBarButton.Flyout>
</AppBarButton>
我的注意力集中在ContentControl
和ContentDialog
上
var cd = new ContentDialog();
cd.HorizontalAlignment = HorizontalAlignment.Stretch;
cd.Content = "Hello User";
await cd.ShowAsync();
但是,即使将水平对齐设置为拉伸,对话框也只占据屏幕的一部分
我想在一个对话框中向用户显示一条消息,该对话框占据整个屏幕的
宽度
,部分占据高度
(如图所示)。如果用户在对话框外单击,对话框将关闭。您可以为此创建一个用户控件。设置其宽度和高度以覆盖全屏,并设置对话框或任何您想要的内容。我也遇到了同样的问题,并通过使用来自的CustomControl解决了这个问题。您不需要整个工具包,只需要以下类:
- 动态文本块
- 对比色转换器
- 自定义对话框
- CustomControlGeneric
谢谢,我现在就要看了。我的问题是在整个屏幕上显示一个对话框:)谢谢你,伙计,你是救世主!
var cd = new ContentDialog();
cd.HorizontalAlignment = HorizontalAlignment.Stretch;
cd.Content = "Hello User";
await cd.ShowAsync();