/// <summary> /// Change localization /// </summary> /// <param name="regionName">Style name</param> private void ChangeLocalization(string regionName) { switch (regionName) { case "Русский": ResourceManagerService.ChangeLocale("ru-Ru"); break; case "English": ResourceManagerService.ChangeLocale("en-US"); break; default: ResourceManagerService.ChangeLocale("en-US"); break; } }
public AdminView() { InitializeComponent(); this.DataContext = new MainScreenViewModel(); // set handles and initialize databinding Logger.Instance.ViewHandle = this; m_Instance = this; // Instantiate settings ResourceManagerService.ChangeLocale(SettingsManager.Instance.Settings.Language); Closing += AdminView_Closing; this.Loaded += new RoutedEventHandler(OnLoaded); CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering); //Refresh Workflow UI if Workingstep gets changed automatically WorkflowManager.WorkingstepChanged += AdminView.Instance.refreshWorkflowUI; DebugInformationManager.Instance.start(); //KinectManager.Instance.allFramesReady += new KinectManager.AllFramesReadyHandler(Instance_allFramesReady); CameraManager.Instance.OnAllFramesReady += Instance_allFramesReady; USBCameraDetector.UpdateConnectedUSBCameras(); }
public MainWindowViewModel() { try { // Позиционирование InitLocation(); // Настройка событий _window.Activated += (o, e) => PositionSave(o, e); _window.Closing += (o, e) => Closing(_window, e); _window.ContentRendered += (o, e) => SetUpAppSettings(_window, e); // Apply localization ResourceManagerService.ChangeLocale(Settings.Same().Localization); // Инициализация списков культур _namesOfCultures = InitNamesOfCultures(); ListOfLocalization = GetListOfLocalization(); SelectedIndexLocalization = _namesOfCultures.IndexOf(Settings.Same().Localization); // Временно скрываем верхнюю линейку управления, что бы не мигало при инициализации цветово палитры ColorZoneVisibility = Visibility.Hidden; // Инициализация главного меню MainMenuItemsInit(); // Random ColorSet PaletteThemeViewModel.ThemeChanged += () => ColorSet.Create().RedefineColors(); MainWindowViewModel.LocalizationChangedEvent += () => ColorSet.Create().RedefineColors(); SettingOptionsViewModel.ApplyPrimaryChanged += () => ColorSet.Create().RedefineColors(); SettingOptionsViewModel.ApplyAccentChanged += () => ColorSet.Create().RedefineColors(); _dispatcherTimerShowBusyMemory = new DispatcherTimer(TimeSpan.FromMilliseconds(1000), DispatcherPriority.Normal, new EventHandler(SetBusyMemoryCaption), Dispatcher.CurrentDispatcher); _dispatcherTimerShowBusyMemory.Stop(); _dispatcherTimerShowBusyMemory.Start(); } catch (Exception e) { Settings.Same().AppStatus = TaskStatus.Faulted; ErrorProcessing.Show(e); (Application.Current as App).Shutdown(); } }
public void BeMenu() { ResourceManagerService.ChangeLocale("be-BE"); }
public void EnMenu() { ResourceManagerService.ChangeLocale("en-US"); }
public void RuMenu() { ResourceManagerService.ChangeLocale("ru-RU"); }
/// <summary> /// Listener for language switching /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// private void buttonSwitchLanguageGerman(object sender, RoutedEventArgs e) { ResourceManagerService.ChangeLocale("de-DE"); SettingsManager.Instance.Settings.Language = "de-DE"; }
private void English(object obj) { ResourceManagerService.ChangeLocale("en-US"); }
private void Russian(object obj) { ResourceManagerService.ChangeLocale("ru-RU"); }