123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using InABox.Wpf;
- using System.Windows;
- namespace InABox.WPF
- {
- /// <summary>
- /// Interaction logic for MemoEditor.xaml
- /// </summary>
- public partial class TextBoxDialog : ThemableWindow
- {
- public TextBoxDialog(string caption, string text)
- {
- InitializeComponent();
- Title = caption;
- Memo.Text = text;
- }
- public string Text
- {
- get => Memo.Text;
- set => Memo.Text = value;
- }
- private void OK_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = true;
- Close();
- }
- private void Cancel_Click(object sender, RoutedEventArgs e)
- {
- DialogResult = false;
- Close();
- }
- public static bool Execute(string caption, ref string text)
- {
- var editor = new TextBoxDialog(caption, text);
- if (editor.ShowDialog() == true)
- {
- text = editor.Memo.Text;
- return true;
- }
- return false;
- }
- }
- }
|