Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

round brackets in xaml syntax

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

like image 878
lukasz Avatar asked Jan 09 '11 17:01

lukasz


1 Answers

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.

like image 162
Andrew Hare Avatar answered Oct 15 '22 13:10

Andrew Hare