protected override void RaiseAllCanExecuteChanged()
 {
     base.RaiseAllCanExecuteChanged();
     ImportAttachmentFromDiskCommand.RaiseCanExecuteChanged();
     ImportAttachmentFromClipboardCommand.RaiseCanExecuteChanged();
     SaveAttachmentToDiskCommand.RaiseCanExecuteChanged();
     OpenAttachmentCommand.RaiseCanExecuteChanged();
     DeleteAttachmentCommand.RaiseCanExecuteChanged();
 }
 public AttachmentViewModel(IAttachment model, MainViewModel main) : base(main)
 {
     if (model == null)
         throw new ArgumentNullException("model");
     this.model = model;
     openAttachment = new OpenAttachmentCommand(this);
     saveAttachment = new SaveAttachmentCommand(this);
     main.RegisterViewModel(model, this);
     LoadViewModels();
 }
Example #3
0
        public AttachmentContext(MessagePart part)
        {
            _part = part;
            if (!part.IsAttachment)
            {
                throw new InvalidOperationException("part must be an attachment");
            }

            _name        = part.FileName;
            _fullname    = part.FileName;
            _openCommand = new OpenAttachmentCommand(part);
        }