public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource) { LogPropWindow scriptPropertyWindow = new LogPropWindow(); //Reload the namespaces and the script in the custom editor dialog if (propertyValue.Value != null) { scriptPropertyWindow.DetailsXML = propertyValue.Value.ToString(); } scriptPropertyWindow.ShowDialog(); if (scriptPropertyWindow.DialogResult.HasValue && scriptPropertyWindow.DialogResult.Value) { propertyValue.StringValue = scriptPropertyWindow.DetailsXML; } }
private void detailsBtn_Click(object sender, RoutedEventArgs e) { LogPropWindow logPropertyWindow = new LogPropWindow(); Button button = sender as Button; DependencyObject g = button.Parent as DependencyObject; Grid parentGrid = g as Grid; TextBox detailsTextBox = parentGrid.Children[5] as TextBox; //Reload the namespaces and the script in the custom editor dialog if (detailsTextBox.Text != null) { logPropertyWindow.DetailsXML = detailsTextBox.Text; } logPropertyWindow.ShowDialog(); if (logPropertyWindow.DialogResult.HasValue && logPropertyWindow.DialogResult.Value) { detailsTextBox.Text = logPropertyWindow.DetailsXML; detailsTextBox.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); detailsTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); } }