public FilterPageViewModel() { Thumbnails = new ThumbnailCollection(); GoBackCommand = CommandFactory.CreateGoBackCommand(); ApplyFilterCommand = new DelegateCommand((parameter) => { var viewModel = (ThumbnailViewModel)parameter; SessionModel.Instance.Photo.Filters.Add(viewModel.Filter); var frame = (Frame)Window.Current.Content; frame.GoBack(); }); }
public async Task WriteThumbnails(ThumbnailCollection thumbs) { // todo }
public StreamPageViewModel(HighlightStrategy highlightStrategy) { HighlightStrategy = highlightStrategy; Thumbnails = new ThumbnailCollection(); GoBackCommand = CommandFactory.CreateGoBackCommand(); SelectPhotoCommand = new DelegateCommand((parameter) => { var viewModel = (ThumbnailViewModel)parameter; try { var copy = new FilteredPhotoModel(viewModel.Model); SessionModel.Instance.Photo = copy; var frame = (Frame)Window.Current.Content; frame.Navigate(typeof(PhotoPage)); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("SelectPhotoCommand failed: " + ex.Message + '\n' + ex.StackTrace); } }); #if WINDOWS_PHONE_APP OpenPhotoCommand = new DelegateCommand( (parameter) => { StartOpenPhotoFile(); }); #else OpenPhotoCommand = new DelegateCommand( async(parameter) => { var file = await PickPhotoFileAsync(); if (file != null) { SessionModel.Instance.Photo = new FilteredPhotoModel(file); var frame = (Frame)Window.Current.Content; frame.Navigate(typeof(PhotoPage)); } }); #endif #if WINDOWS_PHONE_APP OpenFolderCommand = new DelegateCommand( (parameter) => { StartOpenPhotoFolder(); }); #else OpenFolderCommand = new DelegateCommand( async(parameter) => { var folder = await PickPhotoFolderAsync(); if (folder != null && (SessionModel.Instance.Folder == null || folder.Path != SessionModel.Instance.Folder.Path)) { SessionModel.Instance.Folder = folder; await Refresh(); } }); #endif #if !WINDOWS_PHONE_APP CapturePhotoCommand = new DelegateCommand( async(parameter) => { var file = await CapturePhotoFileAsync(); if (file != null) { SessionModel.Instance.Photo = new FilteredPhotoModel(file); var frame = (Frame)Window.Current.Content; frame.Navigate(typeof(PhotoPage)); } }); #endif #if WINDOWS_PHONE_APP ShowAboutCommand = new DelegateCommand((parameter) => { var frame = (Frame)Window.Current.Content; frame.Navigate(typeof(AboutPage)); }); #endif RefreshPhotosCommand = new DelegateCommand( async(parameter) => { await Refresh(); }, () => { return(!Processing); }); RefreshSomePhotosCommand = new DelegateCommand( (parameter) => { RefreshSome(); }, () => { return(!Processing); }); ChangeHighlightStrategyCommand = new DelegateCommand( async(parameter) => { HighlightStrategy = parameter as HighlightStrategy; await Refresh(); }, () => { return(!Processing); }); }
public void WriteThumbnails(ThumbnailCollection thumbs) { // todo }