-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathPromptWindow.xaml.cs
36 lines (31 loc) · 1014 Bytes
/
PromptWindow.xaml.cs
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
using System.Windows;
using RT.Util.Forms;
namespace TankIconMaker
{
partial class PromptWindow : ManagedWindow
{
public PromptWindow()
: base(App.Settings.RenameWindow)
{
InitializeComponent();
MainWindow.ApplyUiZoom(this);
}
private void ok(object sender, RoutedEventArgs e)
{
DialogResult = true;
}
public static string ShowPrompt(Window owner, string name, string title, string label)
{
var wnd = new PromptWindow { Owner = owner };
wnd.Title = title;
wnd.lblName.Content = label;
wnd.ctOkBtn.Text = App.Translation.Prompt.PromptWindowOK;
wnd.ctCancelBtn.Text = App.Translation.Prompt.Cancel;
wnd.ctName.Text = name;
wnd.ctName.Focus();
if (wnd.ShowDialog() != true)
return null;
return wnd.ctName.Text;
}
}
}