Example #1
0
        private void OnFriendDeleted(int friendId)
        {
            IFriendEditViewModel friendEditVmToClose =
                FriendEditViewModels.SingleOrDefault(f => f.Friend.Id == friendId);

            if (friendEditVmToClose != null)
            {
                FriendEditViewModels.Remove(friendEditVmToClose);
            }
        }
Example #2
0
        private void OnFriendDeleted(int friendId)
        {
            var viewModel = FriendEditViewModels
                            .SingleOrDefault(f => f.Friend.Id == friendId);

            if (viewModel != null)
            {
                FriendEditViewModels.Remove(viewModel);
            }
        }
Example #3
0
        private void OnOpenFriendEditView(int friendId)
        {
            var friendEditVm = FriendEditViewModels.SingleOrDefault(vm => vm.Friend.Id == friendId);

            if (friendEditVm == null)
            {
                friendEditVm = CreateAndLoadFriendEditViewModel(friendId);
            }
            SelectedFriendEditViewModel = friendEditVm;
        }
Example #4
0
        private void OnOpenFriendEditView(int friendId)
        {
            var friendEditVm = FriendEditViewModels.SingleOrDefault(vm => vm.Friend.Id == friendId); // ad 2 / 3

            if (friendEditVm == null)                                                                //if not found
            {
                friendEditVm = _friendEditVmCreator();                                               //ad 2
                FriendEditViewModels.Add(friendEditVm);                                              // ad 2
                friendEditVm.Load(friendId);                                                         //ad 2
            }
            SelectedFriendEditViewModel = friendEditVm;
        }
Example #5
0
        private void OnOpenFriendEditView(int friendId)
        {
            IFriendEditViewModel selectedFriendViewModel =
                FriendEditViewModels.SingleOrDefault(model => model.Friend.Id == friendId);

            if (selectedFriendViewModel == null)
            {
                selectedFriendViewModel = CreateAndLoadFriendEditViewModel(friendId);
            }

            SelectedFriendEditViewModel = selectedFriendViewModel;
        }
Example #6
0
        private void OnOpenFriendEditView(int friendId)
        {
            var friendEditVm = FriendEditViewModels.SingleOrDefault(vm => vm.Friend.Id == friendId);

            if (friendEditVm == null)
            {
                friendEditVm = _friendEditVmCreator();
                FriendEditViewModels.Add(friendEditVm);
                friendEditVm.Load(friendId);
            }
            SelectedFriendEditViewModel = friendEditVm;
        }
Example #7
0
        private void OnOpenFriendTab(int friendId)
        {
            var viewModel = FriendEditViewModels
                            .SingleOrDefault(vm => vm.Friend.Id == friendId);

            if (viewModel == null)
            {
                viewModel = _friendEditViewModelCreator();
                FriendEditViewModels.Add(viewModel);
                viewModel.Load(friendId);
            }
            SelectedFriendEditViewModel = viewModel;
        }
Example #8
0
 private void OnDeleteFriend(int friendId)
 {
     FriendEditViewModels.Remove(
         FriendEditViewModels.SingleOrDefault <IFriendEditViewModel>(model => model.Friend.Id == friendId));
 }