public MainWindowViewModel() { Locations = new LocationCollection(); TestContent = "Wahaha"; Locations.Add(new Location(0, 0)); Locations.Add(new Location(101, 110)); Locations.Add(new Location(390, 450)); Person person = new Person(); person.Name = "Steve Ballmer"; person.Image = new BitmapImage(new Uri("image/photo.png", UriKind.Relative)); Location loc = new Location(500, 583); loc.PersonInfo = person; Locations.Add(loc); string dataPath = Environment.CurrentDirectory; CallRecordData = new XmlDataProvider(); CallRecordData.Source = new Uri(dataPath + "/data/2013-03-16.xml"); CallRecordData.InitialLoad(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); #region setup test data Random random = new Random(); List<Person> personList = new List<Person>(); for (int i = 0; i < 1000; i++) { Person person = new Person(); person.ID = i; person.Name = "Person" + i.ToString("0000"); person.Age = random.Next(100); person.IsMale = random.Next(2) == 0; person.BloodType = new[] { "A", "B", "O", "AB" }[random.Next(4)]; personList.Add(person); } _dataStore = personList.ToArray(); #endregion this.InitSearchCondition(); }