Parentheses in xaml syntax

when I use ColorAnimation to change the Background of control I use the following syntax:

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

I am very glad that it works, but I could not find any information about parentheses in the xaml link syntax ...

So, could you explain where this syntax came from, and what the curly brace actually means?

It would be very helpful. Thanks

+7
source share
1 answer

See XAML PropertyPath Syntax :

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

  • The path is specified in XAML, which is in a style or template that does not have a specified target type. qualified use is usually not valid for cases other than this, because in non-standard, non-standard cases, the property exists on the instance, not the type.

  • The property is an attached property.

  • You are attached to a static property.

+7
source

All Articles