-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChoiceWindow.xaml.cs
45 lines (41 loc) · 1.33 KB
/
ChoiceWindow.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
37
38
39
40
41
42
43
44
45
using System.Windows;
using MVC.Communication;
using Translator.WPF;
namespace MVC.WPF {
/// <summary>
/// Interaction logic for ChoiceWindow.xaml
/// </summary>
public partial class ChoiceWindow : AViewWindow {
public ChoiceWindow(RequestEventArgs e, AViewWindow owner)
: base(owner, null) {
InitializeComponent();
this.Icon = owner.Icon;
TranslationHelpers.translateWindow(this);
int selected = 0;
this.Title = e.title;
messageGrp.Header = e.message;
foreach (string add_me in e.options) {
choiceCombo.Items.Add(add_me);
if (add_me == e.default_option)
choiceCombo.SelectedIndex = selected;
selected++;
}
}
public string selected_item {
get {
return choiceCombo.Text;
}
}
public int selected_index {
get {
return choiceCombo.SelectedIndex;
}
}
private void button1_Click(object sender, RoutedEventArgs e) {
this.DialogResult = true;
}
private void cancelBtn_Click(object sender, RoutedEventArgs e) {
this.DialogResult = false;
}
}
}