public void Initialize() { using (var stream = documentService.GetStream(documentPartPath, MediaTypeNames.Text.Xml, FileMode.Open)) { if (stream.Length == 0) { Root = new AddressBookRoot(); foreach (var contact in SampleDataProvider.CreateContacts()) { Root.AddContact(contact); } } else { Root = (AddressBookRoot)serializer.Value.ReadObject(stream); } } navigationService.AddNavigationNode("Contacts", ShowAddressBook, CloseAddressBook, 2, 1); }
public SampleContactViewModel(IContactView view) : base(view) { Contact = SampleDataProvider.CreateContacts()[0]; }
public SampleContactListViewModel() : base(new MockContactListView()) { Contacts = SampleDataProvider.CreateContacts(); SelectedContact = Contacts.First(); FilterText = "My filter text"; }
public SampleContactViewModel() : base(new MockContactView()) { Contact = SampleDataProvider.CreateContacts().First(); }
public void CreateContactsTest() { var contacts = SampleDataProvider.CreateContacts(); Assert.IsTrue(contacts.Any()); }
public void CreateContactsTest() { IReadOnlyList <Contact> contacts = SampleDataProvider.CreateContacts(); Assert.IsTrue(contacts.Any()); }
public SampleContactListViewModel(IContactListView view) : base(view) { Contacts = SampleDataProvider.CreateContacts(); SelectedContact = Contacts[0]; FilterText = "My filter text"; }