-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainViewModel.cs
30 lines (25 loc) · 909 Bytes
/
MainViewModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using DevExpress.Mvvm;
using OrgChartBindingExample.Model;
using System.Collections.Generic;
namespace OrgChartBindingExample.ViewModels {
public class MainViewModel : ViewModelBase {
public IList<Contact> Contacts { get; protected set; }
public MainViewModel() {
if (!IsInDesignMode)
InitializeInRuntime();
else
InitializeInDesingMode();
}
void InitializeInRuntime() {
Contacts = new ContactContextInitializer().Generate();
}
void InitializeInDesingMode() {
Contacts = new List<Contact>() {
new Contact("FirstName", "LastName") {
Gender = Gender.Female, Email = "email", Phone = "(555)555-0000",
Address = "Address", City = "City", State = "AA", Zip = "11111",
},
};
}
}
}