public InlineImageViewModel(string contentType, Upload upload, IMessageBus bus, Func<string, IImageView> imageViewCreator)
            : base(upload)
        {
            _imageViewCreator = imageViewCreator;
            ShowFullSizeImageCommand = new ReactiveCommand(
                this.ObservableForProperty(vm => vm.File).Select(c => c.Value != null));
            ShowFullSizeImageCommand.Subscribe(ViewImage);
            bus.Listen<FileDownloadedMessage>().Where(msg => msg.Url == Upload.FullUrl)
                .SubscribeUI(msg =>
                    {
                        File = msg.File;
                        ShowAnimated = contentType.Equals("image/gif", StringComparison.OrdinalIgnoreCase);
                        ShowUnanimated = !ShowAnimated;
                    });

            bus.SendMessage(new RequestDownloadFileMessage(Upload.FullUrl));
        }
Exemple #2
0
 public UploadReceivedMessage(Upload upload, Guid correlation)
 {
     Upload = upload;
     Correlation = correlation;
 }
Exemple #3
0
 public FileUploadedMessage(Guid correlationId, string path, Upload upload)
     : base(correlationId)
 {
     Path = path;
     Upload = upload;
 }
 public FileViewModel(Upload upload)
 {
     _upload = upload;
 }