FrameworkPropertyMetadataOptions in Silverlight

百般思念 提交于 2019-12-22 14:03:51

问题


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

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