public ContactViewModel(Contact contact, IPhoneCodeManager phoneCodeManager) { this.contact = contact; this.phoneCodeManager = phoneCodeManager; UpdateArea(); deleteCommand = new DelegateCommand(Delete); editCommand = new DelegateCommand(Edit); contact.EmailChanged += Contact_EmailChanged; contact.PhoneChanged += Contact_PhoneChanged; contact.PhoneCodeChanged += Contact_PhoneCodeChanged; }
public MainViewModel(IContactManager contactManager, IPhoneCodeManager phoneCodeManager, IViewModelFactory viewModelFactory) { this.contactManager = contactManager; this.phoneCodeManager = phoneCodeManager; this.viewModelFactory = viewModelFactory; cancelCommand = new DelegateCommand(Cancel); loadedCommand = new DelegateCommand(Load); saveCommand = new DelegateCommand(Save, () => CanSave); contactManager.ContactAdded += ContactManager_ContactAdded; contactManager.ContactDeleted += ContactManager_ContactDeleted; PropertyChanged += MainViewModel_PropertyChanged; }
public ViewModelFactory(IPhoneCodeManager phoneCodeManager) { this.phoneCodeManager = phoneCodeManager; }