What do parentheses in binding paths mean?

我与影子孤独终老i 提交于 2019-11-29 04:09:08

The () parentheses refer to Attached Properties.

Binding to an Attached Property

Quoting the MSDN library (I'm quoting MSDN here because I couldn't have written it down better):

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

For use as storyboard target, the property specified as propertyName must be a DependencyProperty.

(Validation.Errors) references the attached property Errors in the Validation class. Since the binding has a RelativeSource = Self, it's gonna look for the value of that attached property with respect to the TextBox itself.

This below msdn link is neatly explaining about the validation rule and sequences as well as how to use.

http://msdn.microsoft.com/en-us/library/system.windows.controls.validation.errors.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!