请问如何在xaml中定义这样的grid?
如果window为宽屏幕(16:9),Grid为window中央4:3区域,如果window为标准屏(4:3),那么Grid为windows所有区域,请问这样的条件Grid在xaml中如何定义?
[解决办法]
最简单可以理解为:
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Viewbox> <Grid Width="800" Height="600" Background="Yellow"> </Grid> </Viewbox></Window>