我希望将页边距设置为所有页面的默认值。我用过的高度
<System:Double x:Key="Height">20</System:Double>但是保证金是'0,2,0,0‘,我必须使用的类型是什么?
我不想用风格和风格。
发布于 2013-11-06 06:31:45
对于Margin,您希望使用Thickness属性来设置它,所以不要使用系统:双重尝试;
<Thickness x:Key="Height" Left="0" Top="2" Right="0" Bottom="0" />
<Button Margin="{StaticResource Height}" Content="Hey I have a Margin now"/>希望这能有所帮助。
发布于 2020-06-09 06:35:19
尝试将边距定义为资源的简化方法。
<Thickness x:Key="MarginCustom1">100</Thickness> <!--Sets L/T/R/B to 100-->
<Thickness x:Key="MarginCustom2">10,20</Thickness> <!--Sets L/R to 10 and T/B to 20 -->
<Thickness x:Key="MarginCustom3">10,10,10,10</Thickness> <!--Sets L/T/R/B respectively-->https://stackoverflow.com/questions/19805072
复制相似问题