问题
Is there an equivalent of FrameworkPropertyMetadataOptions in Silverlight 5?
I want to be able to FORCE a two way binding from my User Control like this:
public static readonly DependencyProperty SelectedItemProperty =
DependencyProperty.Register("SelectedItem",
typeof(object),
typeof(SearchableGridView),
new FrameworkPropertyMetadata(null,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
new PropertyChangedCallback(OnSelectedItemChanged)));
Telerik has an implementation of this - but I don't want to use Telerik for this control.
Rationale behind forcing the two way binding is because I'd be assigning SelectedItem from my code, so if someone binds to it OneWay by mistake - my assignment would break the binding.
回答1:
AFAIK, there's no such equivalent. Even in SL 5.
来源:https://stackoverflow.com/questions/10691856/frameworkpropertymetadataoptions-in-silverlight