public void EditHomeworkOrExam(BaseViewItemHomeworkExam item) { ShowPopup(AddHomeworkViewModel.CreateForEdit(this, new AddHomeworkViewModel.EditParameter() { Item = item })); }
private async Task HandleQuickAddItem(AddHomeworkViewModel.ItemType 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 = AddHomeworkViewModel.CreateForAdd(mainScreen, new AddHomeworkViewModel.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); } } }
public void Add() { AddHomeworkViewModel.ItemType addType; switch (Type) { case ItemType.Homework: addType = AddHomeworkViewModel.ItemType.Homework; break; case ItemType.Exams: addType = AddHomeworkViewModel.ItemType.Exam; break; default: throw new NotImplementedException("Unknown type"); } MainScreenViewModel.ShowPopup(AddHomeworkViewModel.CreateForAdd(MainScreenViewModel, new AddHomeworkViewModel.AddParameter() { SemesterIdentifier = MainScreenViewModel.CurrentSemesterId, Classes = new List <ViewItemClass>() { ClassViewModel.ViewItemsGroupClass.Class }, SelectedClass = ClassViewModel.ViewItemsGroupClass.Class, Type = addType, HideClassPicker = true })); }
private void AddItem(AddHomeworkViewModel.ItemType type) { MainScreenViewModel.ShowPopup(AddHomeworkViewModel.CreateForAdd(MainScreenViewModel, new AddHomeworkViewModel.AddParameter() { SemesterIdentifier = MainScreenViewModel.CurrentSemesterId, Classes = MainScreenViewModel.Classes, SelectedClass = null, Type = type })); }
private void AddItem(AddHomeworkViewModel.ItemType type, DateTime?dueDate = null, bool useSelectedDate = true) { dueDate = GetDateForAdd(dueDate, useSelectedDate); MainScreenViewModel.ShowPopup(AddHomeworkViewModel.CreateForAdd(MainScreenViewModel, new AddHomeworkViewModel.AddParameter() { SemesterIdentifier = MainScreenViewModel.CurrentSemesterId, Classes = MainScreenViewModel.Classes, SelectedClass = null, Type = type, DueDate = dueDate })); }
private void initializeAdding(AddHomeworkViewModel.ItemType type) { var viewModel = PowerPlannerApp.Current.GetMainScreenViewModel(); if (viewModel != null) { viewModel.ShowPopup(AddHomeworkViewModel.CreateForAdd(viewModel, new AddHomeworkViewModel.AddParameter() { Classes = GetClassesForAdding(), DueDate = DateToUseForNewItems, HideClassPicker = IsClassPickerHidden, HideDatePicker = IsDatePickerHidden, SelectedClass = ClassForNewItems, Type = type })); } }
private async Task HandleQuickAddItem(AddHomeworkViewModel.ItemType type) { if (CurrentAccount == null) { await HandleNormalLaunchActivation(); } var mainScreen = GetMainScreenViewModel(); if (mainScreen != null && mainScreen.CurrentAccount != null && mainScreen.Classes != null && mainScreen.Classes.Count > 0) { Popups.Clear(); mainScreen.Popups.Clear(); mainScreen.ShowPopup(AddHomeworkViewModel.CreateForAdd(mainScreen, new AddHomeworkViewModel.AddParameter() { Classes = mainScreen.Classes.ToArray(), DueDate = DateTime.Today, Type = type })); } }
public BaseEditingImageAttachmentViewModel(AddHomeworkViewModel parent) : base(parent) { _addHomeworkViewModel = parent; }
public EditingNewImageAttachmentViewModel(AddHomeworkViewModel parent, IFile tempFile) : base(parent) { TempFile = tempFile; ImageAttachment = new ImageAttachmentViewModel(TempFile); }
public EditingExistingImageAttachmentViewModel(AddHomeworkViewModel parent, string imageName) : base(parent) { ImageAttachment = new ImageAttachmentViewModel(imageName); }