public PrimeSettingsMasterUi() { InitializeComponent(); List <OsLocalization.OsLocalType> localizations = OsLocalization.GetExistLocalizationTypes(); for (int i = 0; i < localizations.Count; i++) { ComboBoxLocalization.Items.Add(localizations[i].ToString()); } ComboBoxLocalization.SelectedItem = OsLocalization.CurLocalization.ToString(); ComboBoxLocalization.SelectionChanged += delegate { OsLocalization.OsLocalType newType; if (Enum.TryParse(ComboBoxLocalization.SelectedItem.ToString(), out newType)) { OsLocalization.CurLocalization = newType; } }; CheckBoxServerTestingIsActive.IsChecked = PrimeSettingsMaster.ServerTestingIsActive; CheckBoxExtraLogWindow.IsChecked = PrimeSettingsMaster.ErrorLogMessageBoxIsActiv; CheckBoxExtraLogSound.IsChecked = PrimeSettingsMaster.ErrorLogBeepIsActiv; CheckBoxTransactionSound.IsChecked = PrimeSettingsMaster.TransactionBeepIsActiv; CheckBoxExtraLogWindow.Click += CheckBoxExtraLogWindow_Click; CheckBoxExtraLogSound.Click += CheckBoxExtraLogSound_Click; CheckBoxTransactionSound.Click += CheckBoxTransactionSound_Click; CheckBoxServerTestingIsActive.Click += CheckBoxServerTestingIsActive_Click; ChangeText(); OsLocalization.LocalizationTypeChangeEvent += ChangeText; }
public MainWindow() { InitializeComponent(); CreateDir(); _appVm = new ApplicationViewModel(this); _appVm.Load(); _appVm.SelectedClient = _appVm.Clients.Count != 0 ? _appVm.Clients[0] : null; DataContext = _appVm; List <OsLocalization.OsLocalType> localizations = OsLocalization.GetExistLocalizationTypes(); Closing += RobotUi_Closing; for (int i = 0; i < localizations.Count; i++) { ComboBoxLocalization.Items.Add(localizations[i].ToString()); } ComboBoxLocalization.SelectedItem = OsLocalization.CurLocalization.ToString(); ComboBoxLocalization.SelectionChanged += delegate { OsLocalization.OsLocalType newType; if (Enum.TryParse(ComboBoxLocalization.SelectedItem.ToString(), out newType)) { if (OsLocalization.CurLocalization != newType) { OsLocalization.CurLocalization = newType; Local(); } } }; Local(); }