I have subclassed a text editor in order to encapsulate the presence of a ButtonsRight with custom drop down control.
My subclassed editor and the control share a ViewModel. An IEditorDataFilter is provided to translate between the text representation in the text editor portion of the edtior control and the data shown in the custom control drop down.
So far I have been unable to figure out how to make the TextEditor re-run the EditorToDisplay conversion when changes are made in the drop down control.
My attempt so far has been to capture the INotifyPropertyChanged events that are raised by the ViewModel and convert them to edtior property changed events with the following code.
OnPropertyChanged(new PropertyChangedEventArgs(new PropChangeInfo(this, PropertyID.Value, null)));
This does not work, but I can't figure out what I would need to do to make the editor re-run the data filter.
Regards,
Mark
i gave this a try, but the text is not updating in the edit box, despite the fact that I am setting it.
in my handling of my ViewModels property changed event I am doing the following
this.Text = ViewModel.ToString(); with no joy.
where "this" is my subclassed UltraTextEditor.
the text of the editor remains empty.
Generally speaking the IEditorDataFilter interface was not designed to accommodate manually triggering the conversions, but rather to give you a way to intercept the passing of data between the editor and owner during the normal course of operations.
By default UltraComboEditor (closest analog to what you have going on here) triggers the EditorToDisplay conversion by updating the textbox contents when (for example) the user selects an item from the list. Since you are presumably already doing this manually, I don't think you have anything to gain by going through that interface. Simply setting the UltraTextEditor's Text property when the dropdown closes is basically the equivalent of the IEditorDataFilter's EditorToDisplay conversion., at least for a dropdown-like control.