Пример #1
0
 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);
 }
Пример #2
0
 public SampleContactViewModel(IContactView view) : base(view)
 {
     Contact = SampleDataProvider.CreateContacts()[0];
 }
Пример #3
0
 public SampleContactListViewModel() : base(new MockContactListView())
 {
     Contacts        = SampleDataProvider.CreateContacts();
     SelectedContact = Contacts.First();
     FilterText      = "My filter text";
 }
Пример #4
0
 public SampleContactViewModel() : base(new MockContactView())
 {
     Contact = SampleDataProvider.CreateContacts().First();
 }
Пример #5
0
    public void CreateContactsTest()
    {
        var contacts = SampleDataProvider.CreateContacts();

        Assert.IsTrue(contacts.Any());
    }
        public void CreateContactsTest()
        {
            IReadOnlyList <Contact> contacts = SampleDataProvider.CreateContacts();

            Assert.IsTrue(contacts.Any());
        }
Пример #7
0
 public SampleContactListViewModel(IContactListView view) : base(view)
 {
     Contacts        = SampleDataProvider.CreateContacts();
     SelectedContact = Contacts[0];
     FilterText      = "My filter text";
 }