|
@@ -17,6 +17,15 @@ namespace InABox.Wpf.Editors
|
|
|
TextEditor.Text = text;
|
|
|
}
|
|
|
|
|
|
+ public TextEdit(string caption, string prompt, string text = "")
|
|
|
+ {
|
|
|
+ InitializeComponent();
|
|
|
+
|
|
|
+ Title = caption;
|
|
|
+ Prompt.Content = prompt;
|
|
|
+ TextEditor.Text = text;
|
|
|
+ }
|
|
|
+
|
|
|
public string Text
|
|
|
{
|
|
|
get => TextEditor.Text;
|
|
@@ -46,6 +55,18 @@ namespace InABox.Wpf.Editors
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ public static bool Execute(string caption, string prompt, ref string text)
|
|
|
+ {
|
|
|
+ var editor = new TextEdit(caption, prompt, text);
|
|
|
+ if (editor.ShowDialog() == true)
|
|
|
+ {
|
|
|
+ text = editor.Text;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
private void ThemableWindow_Loaded(object sender, RoutedEventArgs e)
|
|
|
{
|