Alwyn
Alwyn

Reputation: 8337

XAML Property Element Not Found in Parent, what does it mean?

I have been drilling through XAML and trying to puzzle together how it actually works.

I have got the following XAML from one of the sample code I downloaded, an earlier question has explained away a large part of my confusion, however... I am still trying to make sense why the following element has a child element that references another type altogether.

<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>

Looking at the XAML syntax documentation, the VisualStateManager is a PropertyElement, however I am confused because VisualStateGroups do not appear to be a property of Border. I believe the example is correct however, I need someone to explain to me, how is an element that's not a "proper" Child element (as that's what Grid is), be a legit part of the parent element?

Upvotes: 0

Views: 157

Answers (1)

Alexis
Alexis

Reputation: 825

VisualStateManager.VisualStateGroups is attached property. Read the following topic, it may help you: http://msdn.microsoft.com/en-us/library/ms749011.aspx

Upvotes: 1

Related Questions