private void BindTextEditorWindow(TextEditorWindow window) { if (window.View != null && View != null) { try { //bind Time BindingUtils.BindProperties(window.View, IViewProperties.PropertyTime, View, IViewProperties.PropertyTime); //TODO: should rebind after changing view if the window is inside a BaseWindow (get its View and bind to it) //bind Captions (note: must do 2nd else freezes, not sure why - would expect the reverse order to be needed) //BindingUtils.BindProperties(View, IActivityProperties.PropertyCaptions, //Note: Since Text component doesn't save/load captions itself, it should use as source the Activity, not the other way around, else order of component loading (e.g. 1st load Captions component in Activity and then Text component) causes loss of captions in the Captions component (gets null value from Text component via the Container two-way binding) // window.View, ITextEditorProperties.PropertyCaptions); //TODO: should rebind after changing view if the window is inside a BaseWindow (get its View and bind to it) } catch (Exception ex) { ErrorDialog.Show("Failed to bind Text component", ex); } } }
public TextEditorWindow AddText() { TextEditorWindow w = (TextEditorWindow)AddWindow(TextEditorWindowFactory, newInstance: true); return(w); }