Ejemplo n.º 1
0
 private static Upload GivenMinimumUpload()
 {
     Upload upload = new Upload();
     upload.Title = "Test";
     upload.Genre = new Genre(0);
     return upload;
 }
Ejemplo n.º 2
0
 public WizardViewModel(
     Upload upload,
     Func<Upload, TitleViewModel> makeTitle,
     Func<Upload, FileViewModel> makeFile,
     Func<Upload, UrlViewModel> makeUrl,
     Func<Upload, ReviewViewModel> makeReview)
 {
     _upload = upload;
     _pages = new IPage[]
     {
         makeTitle(upload),
         makeFile(upload),
         makeUrl(upload),
         makeReview(upload)
     };
 }
Ejemplo n.º 3
0
        public void RunWizard()
        {
            // Start asynchronously loading what the dialog will need.
            Perform(() => _genreRepository.LoadAsync());

            // Create the model and inject it into the view models.
            var upload = new Upload();
            var viewModel = _makeWizardViewModel(upload);

            // Show the dialog with the view models.
            var dialog = new WizardDialog();
            dialog.DataContext = ForView.Wrap(viewModel);
            if (dialog.ShowDialog() ?? false)
            {
                // Call the service.
                Perform(() => _uploadService.UploadAsync(upload));
            }
        }
Ejemplo n.º 4
0
 public ReviewViewModel(Upload upload)
 {
     _upload = upload;
 }
Ejemplo n.º 5
0
 public async Task UploadAsync(Upload upload)
 {
     await Task.Delay(5000);
     throw new ApplicationException("Failed to upload");
 }
Ejemplo n.º 6
0
 public FileViewModel(Upload upload)
 {
     _upload = upload;
 }