public MainWindow() { InitializeComponent(); currentGames = new List <Game>(); LangState.GetState().Languege = Languege.EN; DisplayGames(); }
private void SetEnLocal(LangState langState) { langState.Languege = Languege.EN; LangButton.Text = "EN"; this.Resources = new ResourceDictionary() { Source = new Uri(@"/GameStore;component/ENLocal.xaml", UriKind.Relative) }; TableTitleText.Text = (string)this.TryFindResource("TableTitle"); AllGames.Text = (string)this.TryFindResource("AllGameGenre"); Action.Text = (string)this.TryFindResource("ActionGameGenre"); Shooter.Text = (string)this.TryFindResource("ShooterGameGenre"); Arcade.Text = (string)this.TryFindResource("ArcadeGameGenre"); Fighting.Text = (string)this.TryFindResource("FightingGameGenre"); Race.Text = (string)this.TryFindResource("RaceGameGenre"); Simulator.Text = (string)this.TryFindResource("SimulatorGameGenre"); RPG.Text = (string)this.TryFindResource("RpgGameGenre"); Horror.Text = (string)this.TryFindResource("HorrorGameGenre"); FilterPlaceTitle.Text = (string)this.TryFindResource("FilterTitle"); ByName.Text = (string)this.TryFindResource("FilterByName"); ByPrice.Text = (string)this.TryFindResource("FilterByPrice"); ByRating.Text = (string)this.TryFindResource("FilterByPopularity"); GroupButtonText.Text = (string)this.TryFindResource("CommandToFilter"); }
public static LangState GetState() { if (state == null) { lock (locker) { if (state == null) { state = new LangState(); } } } return(state); }
private void SetEnLocal(LangState langState) { this.Resources = new ResourceDictionary() { Source = new Uri(@"/GameStore;component/ENLocal.xaml", UriKind.Relative) }; Name.Text = (string)this.TryFindResource("GameViewName"); Developer.Text = (string)this.TryFindResource("GameViewDeveloper"); Genre.Text = (string)this.TryFindResource("GameViewGenre"); Rating.Text = (string)this.TryFindResource("GameViewRating"); OS.Text = (string)this.TryFindResource("GameViewOS"); Processor.Text = (string)this.TryFindResource("GameViewProcessor"); RAM.Text = (string)this.TryFindResource("GameViewRAM"); FreeMemory.Text = (string)this.TryFindResource("GameViewFreeMemory"); }
private void FieldsInit() { LangState langState = LangState.GetState(); switch (langState.Languege) { case Languege.EN: SetEnLocal(langState); break; case Languege.RU: SetRuLocal(langState); break; default: break; } }
private void LangButton_Click(object sender, RoutedEventArgs e) { LangState langState = LangState.GetState(); switch (langState.Languege) { case Languege.EN: SetRuLocal(langState); break; case Languege.RU: SetEnLocal(langState); break; default: break; } }
private void SetEnLocal(LangState langState) { this.Resources = new ResourceDictionary() { Source = new Uri(@"/GameStore;component/ENLocal.xaml", UriKind.Relative) }; NameLabel.Text = (string)this.TryFindResource("DataUpdateName"); SmallNameLabel.Text = (string)this.TryFindResource("DataUpdateSmallName"); DeveloperLabel.Text = (string)this.TryFindResource("DataUpdateDeveloper"); GenreLabel.Text = (string)this.TryFindResource("DataUpdateGenre"); ImageLabel.Text = (string)this.TryFindResource("DataUpdateImage"); RatingLabel.Text = (string)this.TryFindResource("DataUpdateRating"); PriceLabel.Text = (string)this.TryFindResource("DataUpdatePrice"); DescriptionLabel.Text = (string)this.TryFindResource("DataUpdateDescription"); OSLabel.Text = (string)this.TryFindResource("DataUpdateOS"); ProcessorLabel.Text = (string)this.TryFindResource("DataUpdateProcessor"); RAMLabel.Text = (string)this.TryFindResource("DataUpdateRAM"); FreeMemoryLabel.Text = (string)this.TryFindResource("DataUpdateFreeMemory"); ExitButton.Content = (string)this.TryFindResource("DataUpdateExitButton"); EnterButton.Content = (string)this.TryFindResource("DataUpdateEnterButton"); ImageButton.Content = (string)this.TryFindResource("DataUpdateImageButton"); }