forked from crskycode/GARbro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnterMaskDialog.xaml.cs
33 lines (30 loc) · 946 Bytes
/
EnterMaskDialog.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
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace GARbro.GUI
{
/// <summary>
/// Interaction logic for EnterMaskDialog.xaml
/// </summary>
public partial class EnterMaskDialog : Window
{
public EnterMaskDialog (IEnumerable<string> mask_list)
{
InitializeComponent ();
Mask.ItemsSource = mask_list;
Mask.Text = "*.*";
}
private void Button_Click (object sender, RoutedEventArgs e)
{
this.DialogResult = true;
}
private void Mask_Loaded (object sender, RoutedEventArgs e)
{
var text_box = (TextBox)Mask.Template.FindName ("PART_EditableTextBox", Mask);
FocusManager.SetFocusedElement (this, text_box);
text_box.SelectionStart = 2;
text_box.SelectionLength = 1;
}
}
}