示例#1
0
        private async void OnSignInOrOut()
        {
            // EEP, cheesy!!
            if (_signInButtonText == SIGN_IN)
            {
                StatusMessage     = "Signing in";
                SignInButtonText  = SIGN_OUT;
                SignInButtonColor = new SolidColorBrush(Colors.Red);

                if (_officeGraphClient.Initialize())
                {
                    OnReload();
                }
            }
            else
            {
                StatusMessage     = "Signing out..";
                SignInButtonText  = SIGN_IN;
                SignInButtonColor = new SolidColorBrush(Colors.Green);
                await _officeGraphClient.SignOut();

                _me           = null; AnnounceProperty(nameof(Me));
                _myImageBytes = null; AnnounceProperty(nameof(MyImage));
            }
            StatusMessage = "Ok";
        }