//Changes the current view, to Events/ToDoList view, according to the type of rhe selected item in TodayActivity view public void SeeDetailedActivity(IActivityEntity activity) { if (activity.GetType().Equals(typeof(Event))) { CurrentView = new EventsViewModel(activity as Event); } else { CurrentView = new ToDoListViewModel(activity as TaskToComplete); } }
//Constructor public MainViewModel() { ContactVM = new ContactsViewModel(); EventsVM = new EventsViewModel(); ToDoListVM = new ToDoListViewModel(); TodayActivityVM = new TodayActivityViewModel(this); CurrentView = TodayActivityVM; ContactsViewSwitchCommand = new ViewSwitchCommand(DisplayContactView); EventsViewSwitchCommand = new ViewSwitchCommand(DisplayEventsView); ToDoListViewSwitchCommand = new ViewSwitchCommand(DisplayToDoListtView); }