1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Windows;
namespace FLY.ControlLibrary
{
/// <summary>
/// 提示输入文本框
/// </summary>
public partial class Prompt : WindowBigClose
{
public Prompt()
{
InitializeComponent();
}
public static bool Show(string message, ref string input)
{
Prompt mb = new Prompt();
mb.textblock_message.Text = message;
mb.textbox_input.Text = input;
mb.Owner = Application.Current.MainWindow;
if (mb.ShowDialog() == true)
{
input = mb.textbox_input.Text;
return true;
}
else
{
return false;
}
}
private void button_ok_Click(object sender, RoutedEventArgs e)
{
this.DialogResult = true;
this.Close();
}
}
}