private void CreateCountdown() { var viewModel = new EditCountdownViewModel(this) { Date = DateTime.Today }; navigationService.EditCountdown(viewModel); }
private void EditCountdown() { var countdown = selectedCountdown; var viewModel = new EditCountdownViewModel(this) { CountdownId = countdown.CountdownId, Name = countdown.Name, Date = countdown.SelectedDate.Date, Time = countdown.SelectedDate.TimeOfDay, IsRecurrent = countdown.IsRecurrent, ImageData = countdown.ImageData, FinishedNotification = countdown.FinishedNotification, PinnedToStart = countdown.PinnedToStart }; navigationService.EditCountdown(viewModel); }
public async void SelectImage(EditCountdownViewModel viewModel) { var picker = new FileOpenPicker { ViewMode = PickerViewMode.Thumbnail, SuggestedStartLocation = PickerLocationId.PicturesLibrary }; picker.FileTypeFilter.Add(".jpg"); picker.FileTypeFilter.Add(".jpeg"); picker.FileTypeFilter.Add(".png"); picker.FileTypeFilter.Add(".bmp"); var file = await picker.PickSingleFileAsync(); if (file == null) { return; } var image = await SelectedImage.FromFile(file); if (!image.IsValid) { return; } if (image.IsSquare) { var imageData = await image.AsBytes(); viewModel.ChangeImage(imageData); return; } var cropViewModel = new CropImageViewModel(viewModel) { SelectedImage = image }; Frame.Navigate(typeof(CropImagePage), cropViewModel); }
public void EditCountdown(EditCountdownViewModel viewModel) { Frame.Navigate(typeof(EditCountdownPage), viewModel); }
public CropImageViewModel(EditCountdownViewModel parent) { this.parent = parent; }