protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     activeAccount = (Account)e.Parameter;
     //set inkCanvas size
     rootPage = MainPage.Current;
     this.SetGridSize();
 }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     rootPage = MainPage.Current;
     base.OnNavigatedTo(e);
     this.activeAccount = (Account)e.Parameter;
     this.textAccountName.Text = this.activeAccount.accountNO;
 }
        /// <summary>
        /// The function that will be called when this frame is navigated to.
        ///
        /// Checks to see if Microsoft Passport is available and checks to see if an 
        /// account was passed in.
        ///
        /// If an account was passed, check if it uses Microsoft Passport.
        /// and set the "adding user" flag so we don't add a new account
        /// to the list of users.
        /// </summary>
        /// <param name="e"></param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            if (e.Parameter != null)
            {
                m_account = (Account)e.Parameter;
                textbox_Username.Text = m_account.Email;
                textbox_Username.IsEnabled = false;
                if (this.m_account.UsesPassport)
                {
                    LoginHelp loginHelp = new LoginHelp(this.m_account);
                    bool rev = await loginHelp.SignInPassport();
                    if (rev)
                    {
                        this.Frame.Navigate(typeof(AccountDetails), this.m_account);
                    }
                }
            }
            var accountList = await AccountsHelper.LoadAccountList();
            if (accountList.Count > 1)
            {
                this.btnSelectUser.Visibility = Visibility.Visible;
            }
            else
            {
                this.btnSelectUser.Visibility = Visibility.Collapsed;
            }
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     rootPage = MainPage.Current;
     this.activeAccount = (Account)e.Parameter;
     //read language related resource file .strings/en or zh-cn/resources.resw
     Run run1 = new Run();
     run1.Text = string.Format(ResourceManagerHelper.ReadValue("SelecteHelloDs1"),activeAccount.Name);
     Run run2 = new Run();
     run2.Text = ResourceManagerHelper.ReadValue("SelecteHelloDs2");
     this.textHelloDes.Inlines.Add(run1);
     this.textHelloDes.Inlines.Add(new LineBreak());
     this.textHelloDes.Inlines.Add(run2);
 }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     rootPage = MainPage.Current;
     base.OnNavigatedTo(e);
     this.activeAccount = (Account)e.Parameter;
     string param = this.activeAccount.accountNO;
     if (param != string.Empty)
     {
         this.textAccountLabelInfo.Text = param;
         this.textAccountLabelInfo.IsReadOnly = true;
     }
     else
     {
         this.textAccountLabelInfo.IsReadOnly = false;
     }
 }
Пример #6
0
 public LoginHelp(Account account)
 {
     this.activeAccount = account;
 }
 /// <summary>
 /// Function called when regular username/password sign in button is clicked
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void Button_SignIn_Click(object sender, RoutedEventArgs e)
 {
     if (this.textbox_Username.Text == string.Empty || this.passwordbox_Password.Password == string.Empty)
     {
         this.textblock_ErrorField.Visibility = Visibility.Visible;
         return;
     }
     else
     {
         this.textblock_ErrorField.Visibility = Visibility.Collapsed;
     }
     bool isNewAccount = false;
     if (this.m_account == null)
     {
         this.m_account = new Account() { head = "Assets/head.png", Name = this.textbox_Username.Text, Email = this.textbox_Username.Text, loginCount = 0, UsesPassport = false, isAdd = false };
         isNewAccount = true;
     }
     LoginHelp loginHelp = new LoginHelp(this.m_account);
     bool rev = await loginHelp.SignInPassword(isNewAccount);
     if (rev)
     {
         //Checks to see if Passport is ready to be used.
         //1. Having a connected MSA Account
         //2. Having a Windows PIN set up for that account on the local machine
         var keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
         if (!this.m_account.UsesPassport && keyCredentialAvailable)
         {
             this.Frame.Navigate(typeof(SelecteHello), this.m_account);
             return;
         }
         this.Frame.Navigate(typeof(AccountDetails), this.m_account);
     }
     else
     {
         rootPage.ShowMessage("SignIn Failure");
     }
 }