Пример #1
0
        private void AddPhone()
        {
            if (AddAddressPhoneEmailInteractioNRequest != null)
            {
                var itemVm = _phoneVmFactory.GetViewModelInstance(new KeyValuePair <string, object>("item", new Phone()));

                var confirmation = new ConditionalConfirmation {
                    Title = "Enter phone details".Localize(), Content = itemVm
                };

                AddAddressPhoneEmailInteractioNRequest.Raise(confirmation,
                                                             (x) =>
                {
                    if (x.Confirmed)
                    {
                        var phoneToAdd =
                            (x.Content as IPhoneNumberDialogViewModel)
                            .InnerItem;

                        ContactPhones.Add(phoneToAdd);
                        AddPhoneCommand.RaiseCanExecuteChanged();
                    }
                });
            }
        }
Пример #2
0
 private void RemovePhone(Phone item)
 {
     if (ContactPhones != null)
     {
         ContactPhones.Remove(item);
         AddPhoneCommand.RaiseCanExecuteChanged();
     }
 }