Esempio n. 1
0
        public PartialViewResult Index()
        {
            HttpCookie cookie = Request.Cookies["_culture"];

            var viewModel = new SelectLanguageViewModel
            {
                Languages = GetAvailableLanguages(cookie == null ? "" : cookie.Value)
            };

            return(PartialView(viewModel));
        }
Esempio n. 2
0
    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();
    }
Esempio n. 3
0
    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(() =>
        {
        });
    }