private async Task HandleQuickAddItem(TaskOrEventType type) { if (CurrentAccount == null) { await HandleNormalLaunchActivation(); } var mainScreen = GetMainScreenViewModel(); if (mainScreen != null && mainScreen.CurrentAccount != null && mainScreen.Classes != null && mainScreen.Classes.Count > 0) { Popups.Clear(); var newModel = AddTaskOrEventViewModel.CreateForAdd(mainScreen, new AddTaskOrEventViewModel.AddParameter() { Classes = mainScreen.Classes.ToArray(), DueDate = DateTime.Today, Type = type }); // For iOS, we can't clear and then add, we need to replace if (mainScreen.Popups.Count >= 1) { mainScreen.Popups[0] = newModel; while (mainScreen.Popups.Count > 1) { mainScreen.Popups.RemoveAt(1); } } else { mainScreen.ShowPopup(newModel); } } }
private void AddItem(TaskOrEventType type) { MainScreenViewModel.ShowPopup(AddTaskOrEventViewModel.CreateForAdd(MainScreenViewModel, new AddTaskOrEventViewModel.AddParameter() { SemesterIdentifier = MainScreenViewModel.CurrentSemesterId, Classes = MainScreenViewModel.Classes, SelectedClass = null, Type = type })); }
public void Add() { MainScreenViewModel.ShowPopup(AddTaskOrEventViewModel.CreateForAdd(MainScreenViewModel, new AddTaskOrEventViewModel.AddParameter() { SemesterIdentifier = MainScreenViewModel.CurrentSemesterId, Classes = new List <ViewItemClass>() { ClassViewModel.ViewItemsGroupClass.Class }, SelectedClass = ClassViewModel.ViewItemsGroupClass.Class, Type = Type, HideClassPicker = true })); }
private void initializeAdding(TaskOrEventType type) { var viewModel = PowerPlannerApp.Current.GetMainScreenViewModel(); if (viewModel != null) { viewModel.ShowPopup(AddTaskOrEventViewModel.CreateForAdd(viewModel, new AddTaskOrEventViewModel.AddParameter() { Classes = GetClassesForAdding(), DueDate = DateToUseForNewItems, HideClassPicker = IsClassPickerHidden, HideDatePicker = IsDatePickerHidden, SelectedClass = ClassForNewItems, Type = type })); } }