Margin value type in resources

两盒软妹~` 提交于 2019-12-07 02:30:14

问题


I want to set margin as default for all page. For height i used

    <System:Double x:Key="Height">20</System:Double>

But margin is '0,2,0,0' what the type i have to use?

I don't want to use style and setter.


回答1:


For Margin you want the Thickness attributes to set it, so instead of a System:Double try;

<Thickness x:Key="Height" Left="0" Top="2" Right="0" Bottom="0" />

<Button Margin="{StaticResource Height}" Content="Hey I have a Margin now"/>

Hope this helps.



来源:https://stackoverflow.com/questions/19805072/margin-value-type-in-resources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!