private void editItem_Click(object sender, RoutedEventArgs e) { var editWindow = new dynEditWindow(); editWindow.editText.TextChanged += delegate { var expr = editWindow.editText.GetBindingExpression(TextBox.TextProperty); if (expr != null) { expr.UpdateSource(); } }; //setup a binding with the edit window's text field editWindow.editText.DataContext = DataContext as dynNoteViewModel; var bindingVal = new System.Windows.Data.Binding("Text") { Mode = BindingMode.TwoWay, Source = (DataContext as dynNoteViewModel), UpdateSourceTrigger = UpdateSourceTrigger.Explicit }; editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal); if (editWindow.ShowDialog() != true) { return; } }
private void editItem_Click(object sender, RoutedEventArgs e) { dynEditWindow editWindow = new dynEditWindow(); //set the text of the edit window to begin editWindow.editText.Text = noteText.Text; if (editWindow.ShowDialog() != true) { return; } //set the value from the text in the box noteText.Text = editWindow.editText.Text; }
public override void editWindowItem_Click(object sender, RoutedEventArgs e) { var editWindow = new dynEditWindow { DataContext = this }; var bindingVal = new System.Windows.Data.Binding("Value") { Mode = BindingMode.TwoWay, Converter = new StringDisplay(), NotifyOnValidationError = false, Source = this, UpdateSourceTrigger = UpdateSourceTrigger.Explicit }; editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal); if (editWindow.ShowDialog() != true) { return; } }
private void editWindowItem_Click(object sender, RoutedEventArgs e) { var editWindow = new dynEditWindow(); editWindow.DataContext = this; var bindingVal = new System.Windows.Data.Binding("Measure.Item.Length") { Mode = BindingMode.TwoWay, Converter = new RevitProjectUnitsConverter(), ConverterParameter = Measure, NotifyOnValidationError = false, Source = this, UpdateSourceTrigger = UpdateSourceTrigger.Explicit }; editWindow.editText.SetBinding(System.Windows.Controls.TextBox.TextProperty, bindingVal); if (editWindow.ShowDialog() != true) { return; } }
void editWindowItem_Click(object sender, RoutedEventArgs e) { dynEditWindow editWindow = new dynEditWindow(); //set the text of the edit window to begin editWindow.editText.Text = script; if (editWindow.ShowDialog() != true) { return; } //set the value from the text in the box script = editWindow.editText.Text; this.dirty = true; }
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; } }