Windows phone 7 属性{StaticResource resourcename}值超出范围
我在页面中有一个按钮,定义为:Windows phone 7 属性{StaticResource resourcename}值超出范围,windows-phone-7,resources,Windows Phone 7,Resources,我在页面中有一个按钮,定义为: <Button Content="{StaticResource resourcename}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="32" Height="32" > 资源“resourcename”在应用程序中的定义如下: <Grid x:Key="resourcename"> <Path Fill="Bla
<Button Content="{StaticResource resourcename}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="32" Height="32" >
资源“resourcename”在应用程序中的定义如下:
<Grid x:Key="resourcename">
<Path Fill="Black" Stretch="Fill" Data="M7.99799,14.26781 .....
</Grid>
</Application.Resources>
我曾看到人们试图通过存储在资源集合中的UIElement
设置内容,并对此表示不满。我不会采用这种方法,一个问题是,UIElement
可能只是单个UIElement
的子元素。更好的方法可能是在参考资料中存储DataTemplate
,并将该DataTemplate
设置为按钮的ContentTemplate