round brackets in xaml syntax
Asked Answered
C

1

8

when I'm using ColorAnimation to change Background of control i'm using following syntax:

<ColorAnimation Duration="0:0:0.5" 
 Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" 
 To="Black" />

I'm very happy it works but I couldn't find any information about round braces in xaml syntax reference ...

So could you please explain where does this syntax come from and what does the round brace actually mean?

It would be very helpful. Thanks

Checkerbloom answered 9/1, 2011 at 17:27 Comment(0)
F
9

Please see PropertyPath XAML Syntax:

The parentheses indicate that this property in a PropertyPath should be constructed using a partial qualification. It can use an XML namespace to find the type with an appropriate mapping. The ownerType searches types that a XAML processor has access to, through the XmlnsDefinitionAttribute declarations in each assembly. Most applications have the default XML namespace mapped to the http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace, so a prefix is usually only necessary for custom types or types otherwise outside that namespace. propertyName must resolve to be the name of a property existing on the ownerType. This syntax is generally used for one of the following cases:

  • The path is specified in XAML that is in a style or template that does not have a specified Target Type. A qualified usage is generally not valid for cases other than this, because in non-style, non-template cases, the property exists on an instance, not a type.

  • The property is an attached property.

  • You are binding to a static property.

Finsen answered 9/1, 2011 at 17:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.