示例#1
0
        /*
         * private async System.Threading.Tasks.Task Authenticate()
         * {
         *  MobileServiceUser user = await authenticationService.LoginEasyAsync();
         *  CurrentUser = new User();
         *  CurrentUser.UserId = user.UserId;
         *  CurrentUser.Name = "Dummy";
         * }
         */

        async void FriendsViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == CurrentUserPropertyName)
            {
                // We haven't seen this user before
                if (CurrentUser.Id == 0)
                {
                    CurrentUser.MpnsChannel = PushChannel.ToString();
                    await chatService.CreateUserAsync(CurrentUser);
                }
                ReadFriends();
            }
            else if (e.PropertyName == PushChannelPropertyName)
            {
                RaisePropertyChanged(ContactsPropertyName);
                notificationService.RegisterNotificationHubs(PushChannel.ToString());
            }
        }