I want to programmatically find out what the default binding mode for a property will be.
For example, if I check it for TextBox.TextProperty , it should be BindingMode.TwoWay , but if it is ItemsControl.ItemsSourceProperty , it should be BindingMode.OneWay .
I implemented a custom MarkupExtension and still got this in my code:
public override object ProvideValue(IServiceProvider provider) { var service = provider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget; if (service != null) { var target = service.TargetObject as DependencyObject; var property = service.TargetProperty as DependencyProperty;
source share