Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.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
Wpf 在父级中找不到XAML属性元素,这意味着什么?_Wpf_Silverlight_Xaml_Windows Runtime - Fatal编程技术网

Wpf 在父级中找不到XAML属性元素,这意味着什么?

Wpf 在父级中找不到XAML属性元素,这意味着什么?,wpf,silverlight,xaml,windows-runtime,Wpf,Silverlight,Xaml,Windows Runtime,我一直在钻研XAML,试图弄清它实际上是如何工作的 我从下载的一个示例代码中获得了以下XAML,它解释了我的大部分困惑,但是。。。我仍在试图弄清楚为什么下面的元素有一个子元素引用了另一种类型 <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" > <VisualStateManager.VisualStateGroups> <!-- Snipped code i

我一直在钻研XAML,试图弄清它实际上是如何工作的

我从下载的一个示例代码中获得了以下XAML,它解释了我的大部分困惑,但是。。。我仍在试图弄清楚为什么下面的元素有一个子元素引用了另一种类型

<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >

    <VisualStateManager.VisualStateGroups>
        <!-- Snipped code irrelevant - just various storyboards-->
    </VisualStateManager.VisualStateGroups>
        <Grid x:Name="InnerGrid" 
              Opacity="1"
              Margin="0,5,0,5" 
              Background="{StaticResource TransparentColor}">
                  <ContentPresenter x:Name="ContentPresenter"  
                        Foreground="{StaticResource TransparentColor}"
                        ContentTemplate="{TemplateBinding ContentTemplate}" 
                        Content="{TemplateBinding Content}" 
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                        Margin="{TemplateBinding Padding}" 
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
       </Grid>
</Border>


查看XAML语法文档,
VisualStateManager
是一个属性,但是我感到困惑,因为VisualStateGroups似乎不是
Border
的属性。我相信这个例子是正确的,但是,我需要有人向我解释,一个不是“适当的”
子元素的元素(正如
Grid
所示)如何成为父元素的合法部分?

VisualStateManager.VisualStateGroups是附加属性。阅读以下主题,它可能会对您有所帮助:

谢谢,该链接非常有用。