【发布时间】:2014-02-16 21:13:44
【问题描述】:
<Grid.RowDefinitions>
<RowDefinition Height="4*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
我想在 XAML 的其他地方定义 4/3 比率,然后使用它。像这样的:
<System:Double x:Key="Top_Part">4</System:Double>
<System:Double x:Key="Bottom_Part">3</System:Double>
<Grid.RowDefinitions>
<RowDefinition Height="{StaticResource Top_Part}"/>
<RowDefinition Height="{StaticResource Bottom_Part}"/>
</Grid.RowDefinitions>
当然,这段代码是不正确的,不会产生预期的效果。我怎样才能正确地做到这一点?
【问题讨论】:
标签: wpf visual-studio-2010 xaml resources