Win universal app UWP中ContentDialog的高度
如何在UWP应用程序中指定ContentDialog的高度Win universal app UWP中ContentDialog的高度,win-universal-app,uwp-xaml,Win Universal App,Uwp Xaml,如何在UWP应用程序中指定ContentDialog的高度 在手机上,它几乎扩展了整个页面,甚至对话框内容的高度是页面的三分之一。非常简单。在XAML中执行此操作: <ContentDialog x:Name="MyContentDialog" Height="100" Width="150" Title="Lorem Ipsum" PrimaryButtonText="OK" IsPrimar
在手机上,它几乎扩展了整个页面,甚至对话框内容的高度是页面的三分之一。非常简单。在XAML中执行此操作:
<ContentDialog x:Name="MyContentDialog" Height="100" Width="150"
Title="Lorem Ipsum"
PrimaryButtonText="OK" IsPrimaryButtonEnabled="True">
<StackPanel Width="150" Height="100">
<TextBlock Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit" TextWrapping="Wrap" />
</StackPanel>
</ContentDialog>
或者使用MaxHeight属性。这里有一个很好的链接
如果您有太多的内容-您可以尝试在ContentDialog中放置或非常轻松地更新。在XAML中执行此操作:
<ContentDialog x:Name="MyContentDialog" Height="100" Width="150"
Title="Lorem Ipsum"
PrimaryButtonText="OK" IsPrimaryButtonEnabled="True">
<StackPanel Width="150" Height="100">
<TextBlock Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit" TextWrapping="Wrap" />
</StackPanel>
</ContentDialog>
或者使用MaxHeight属性。这里有一个很好的链接
如果内容太多-可以尝试放置在ContentDialog内部或更新固定高度的问题在于它取决于宽度,这也很难设置固定的wince。它受设备宽度的影响。有没有办法将ContentDialog高度设置为它所承载控件的高度?固定高度的问题在于它取决于宽度,这也很难设置固定的wince。它受设备宽度的影响。有没有办法将ContentDialog高度设置为它承载的控件的高度?