Example #1
0
        private void OnAcceptClick(object sender, EventArgs e)
        {
            if (!NetworkService.IsNetworkAvailable(true))
            {
                return;
            }

            // To not allow cancel a request to login or
            // create account once that is started
            SetApplicationBar(false);

            if (_loginAndCreateAccountViewModelContainer == null)
            {
                _loginAndCreateAccountViewModelContainer = new LoginAndCreateAccountViewModelContainer(this);
            }

            if (Pivot_LoginAndCreateAccount.SelectedItem == PivotItem_Login)
            {
                _loginAndCreateAccountViewModelContainer.LoginViewModel.Login();
            }
            else if (Pivot_LoginAndCreateAccount.SelectedItem == PivotItem_CreateAccount)
            {
                _loginAndCreateAccountViewModelContainer.CreateAccountViewModel.CreateAccount();
            }
        }
Example #2
0
        public LoginPage()
        {
            _loginAndCreateAccountViewModelContainer = new LoginAndCreateAccountViewModelContainer(this);

            this.DataContext = _loginAndCreateAccountViewModelContainer;

            InitializeComponent();

            SetApplicationBar(true);
        }
Example #3
0
        public void SetApplicationBar(bool isEnabled)
        {
            if (this.ApplicationBar == null)
            {
                return;
            }

            if (_loginAndCreateAccountViewModelContainer == null)
            {
                _loginAndCreateAccountViewModelContainer = new LoginAndCreateAccountViewModelContainer(this);
            }

            // Change and translate the current application bar
            _loginAndCreateAccountViewModelContainer.ChangeMenu(
                this.ApplicationBar.Buttons, this.ApplicationBar.MenuItems);

            UiService.ChangeAppBarStatus(this.ApplicationBar.Buttons,
                                         this.ApplicationBar.MenuItems, isEnabled);
        }