Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 7 属性{StaticResource resourcename}值超出范围_Windows Phone 7_Resources - Fatal编程技术网

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