static void Main() { var app = new Application(); var window = new RegexEditor(); app.MainWindow = window; app.Run(window); }
private void ShowEditor(string regex, string test, Action<RegexEditor> replacer) { var editor = new RegexEditor { Replacer = replacer }; if (regex != null) { editor.RegularExpression = regex; } if (test != null) { editor.TestingText = test; } var helper = new WindowInteropHelper(editor); helper.EnsureHandle(); helper.Owner = Handle; editor.ShowDialog(); }