void ViewModel_RequestShowNodeRename(object sender, EventArgs e) { var editWindow = new dynEditWindow { DataContext = ViewModel }; var bindingVal = new Binding("NickName") { Mode = BindingMode.TwoWay, NotifyOnValidationError = false, Source = ViewModel, UpdateSourceTrigger = UpdateSourceTrigger.Explicit }; editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal); editWindow.Title = "Edit Node Name"; if (editWindow.ShowDialog() != true) { return; } }
private void ShowRename() { var editWindow = new dynEditWindow { DataContext = this }; var bindingVal = new Binding("NickName") { Mode = BindingMode.TwoWay, NotifyOnValidationError = false, Source = this, UpdateSourceTrigger = UpdateSourceTrigger.Explicit }; editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal); editWindow.Title = "Edit Node Name"; if (editWindow.ShowDialog() != true) { return; } }