码迷,mamicode.com
首页 > Windows程序 > 详细

[WPF系列]- Style - Specify width/height as resource in WPF

时间:2015-01-06 09:47:01      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

<Page
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Page.Resources>
    <sys:Double x:Key="Height">200</sys:Double>
    <sys:Double x:Key="Width">200</sys:Double>
  </Page.Resources>
  <Grid>  
    <Rectangle 
      Height="{StaticResource Height}" 
      Width="{StaticResource Width}" 
      Fill="Blue"/>
  </Grid>
</Page>

[WPF系列]- Style - Specify width/height as resource in WPF

标签:

原文地址:http://www.cnblogs.com/HQFZ/p/4205225.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!