public PartialViewResult Index() { HttpCookie cookie = Request.Cookies["_culture"]; var viewModel = new SelectLanguageViewModel { Languages = GetAvailableLanguages(cookie == null ? "" : cookie.Value) }; return(PartialView(viewModel)); }
protected override void OnCreate(IBundle bundle) { viewLocator = Context.GetApplicationContext().GetService <IUIViewLocator>(); this.viewModel = new SelectLanguageViewModel(); BindingSet <SelectLanguageView, SelectLanguageViewModel> bindingSet = this.CreateBindingSet(viewModel); // binding interaction request bindingSet.Bind().For(v => v.OnClosePopup).To(vm => vm.ClosePopupRequest); // binding command bindingSet.Bind(this.variables.Get <Button>("btn_close")).For(v => v.onClick).To(vm => vm.ClosePopupCommand); bindingSet.Build(); LoadSystemLanguage(); }
public LoadingGameViewModel() { this.selectLanguageRequest = new InteractionRequest <SelectLanguageViewModel>(this); this.tapToStartRequest = new InteractionRequest(this); SelectLanguageViewModel selectLanguageViewModel = new SelectLanguageViewModel(); this.selectLanguageCommand = new SimpleCommand(() => { Debug.Log("select Language"); this.selectLanguageCommand.Enabled = false; this.selectLanguageRequest.Raise(selectLanguageViewModel, vm => { this.selectLanguageCommand.Enabled = true; }); }); this.tapToStartCommand = new SimpleCommand(() => { }); }