Пример #1
0
        public async void Execute(object parameter)
        {
            try
            {
                if (_friendListViewModel?.FriendListCount >= FriendService.MaxAllowedFriends)
                {
                    GenericMessageDialog.Show(Properties.Resources.FriendListMaxFriendsReached,
                                              DialogIcon.Warning,
                                              DialogOptions.Ok);
                    return;
                }

                var friend = (FriendListItem)parameter;
                _friendListViewModel.FriendListItems.Remove(friend);
                await _friendService.ConfirmFriendRequest(friend.XUid);

                _updateFriendAction();
            }
            catch (Exception ex)
            {
                _logger.Error(ex, ex.Message);
                GenericMessageDialog.Show(Properties.Resources.GenericUnexpectedErrorMessage,
                                          DialogIcon.Error,
                                          DialogOptions.Ok);
            }
        }