OfficeTicTacToe.ViewModels.UserViewModel.UpdatePhotoAsync C# (CSharp) Method

UpdatePhotoAsync() public method

public UpdatePhotoAsync ( CancellationToken token ) : Task
token System.Threading.CancellationToken
return Task
        public async Task UpdatePhotoAsync(CancellationToken token)
        {
            if (token.IsCancellationRequested)
                return;


            if (IsLoadedPhoto)
                return;

            if (String.IsNullOrEmpty(this.UserPrincipalName))
                return;

            var graph = AuthenticationHelper.GetGraphService();

            var tuple = await graph.Me.Photo.GetPhoto(this.UserPrincipalName);

            if (tuple != null)
            {
                this.Photo = tuple.Item1;
                this.PhotoUri = tuple.Item2;

            }

            IsLoadedPhoto = true;
        }
        public RelayCommand UserCommand