public BasicExampleMainModel() { _basicColourMonitor = new PositionMonitor(); _basicColourMonitor.LocationChanged += (sender, args) => BasicColourMonitorText = args.Location.ToString(); _peopleMonitor = new VerticalPositionMonitor(); _peopleMonitor.OrderChanged += PeopleMonitorOnOrderChanged; _people.Add(new Person { FirstName = "Albert", LastName = "Einstein" }); _people.Add(new Person { FirstName = "Neil", LastName = "Tyson" }); _people.Add(new Person { FirstName = "James", LastName = "Willock" }); //i move in esteemed circles ;) _viewModels.Add(new SimpleViewModel { Name = "Alpha", SimpleContent = "This is the alpha content" }); _viewModels.Add(new SimpleViewModel { Name = "Beta", SimpleContent = "Beta content", IsSelected = true }); _viewModels.Add(new SimpleViewModel { Name = "Gamma", SimpleContent = "And here is the gamma content" }); SelectedViewModel = _viewModels[1]; _interTabClient = new BasicExampleInterTabClient(); _addNewPerson = new AnotherCommandImplementation( x => { _newPersonCount++; _people.Add(new Person { FirstName = "Hello_" + _newPersonCount, LastName = "World_" + _newPersonCount }); }); _addNewViewModel = new AnotherCommandImplementation( x => { _newViewModelCount++; _viewModels.Add(new SimpleViewModel() { Name = "New Tab " + _newViewModelCount, SimpleContent = "New Tab Content " + _newViewModelCount }); SelectedViewModel = _viewModels.Last(); }); }
public static void SetPositionMonitor(DependencyObject element, PositionMonitor value) { element.SetValue(PositionMonitorProperty, value); }