public PickAssetViewModel(IAssetService assetRepository,
			IViewModelsFactory<IInputNameDialogViewModel> inputNameVmFactory)
		{
			_assetRepository = assetRepository;
			_inputNameVmFactory = inputNameVmFactory;

			AddressBarItems = new ObservableCollection<AssetEntitySearchViewModelBase>();
			SelectedFolderItems = new ObservableCollection<AssetEntitySearchViewModelBase>();

			CommonNotifyRequest = new InteractionRequest<Notification>();

			OpenItemCommand = new DelegateCommand<object>(RaiseOpenItemRequest);
			RefreshCommand = new DelegateCommand(LoadItems);
			UploadCommand = new DelegateCommand(RaiseUploadRequest, () => ParentItem.Type == AssetType.Container || ParentItem.Type == AssetType.Folder);
			CreateFolderCommand = new DelegateCommand(RaiseCreateFolderRequest);
			RenameCommand = new DelegateCommand(RaiseRenameRequest);
			DeleteCommand = new DelegateCommand(RaiseDeleteRequest);
			ParentItem = new RootSearchViewModel(null);
			CommonConfirmRequest = new InteractionRequest<Confirmation>();

			InputNameDialogRequest = new InteractionRequest<ConditionalConfirmation>();

			AssetPickMode = true;
			RootItemId = null;
		}
Esempio n. 2
0
        public PickAssetViewModel(IAssetService assetRepository,
                                  IViewModelsFactory <IInputNameDialogViewModel> inputNameVmFactory)
        {
            _assetRepository    = assetRepository;
            _inputNameVmFactory = inputNameVmFactory;

            AddressBarItems     = new ObservableCollection <AssetEntitySearchViewModelBase>();
            SelectedFolderItems = new ObservableCollection <AssetEntitySearchViewModelBase>();

            CommonNotifyRequest = new InteractionRequest <Notification>();

            OpenItemCommand      = new DelegateCommand <object>(RaiseOpenItemRequest);
            RefreshCommand       = new DelegateCommand(LoadItems);
            UploadCommand        = new DelegateCommand(RaiseUploadRequest, () => ParentItem.Type == AssetType.Container || ParentItem.Type == AssetType.Folder);
            CreateFolderCommand  = new DelegateCommand(RaiseCreateFolderRequest);
            RenameCommand        = new DelegateCommand(RaiseRenameRequest);
            DeleteCommand        = new DelegateCommand(RaiseDeleteRequest);
            ParentItem           = new RootSearchViewModel(null);
            CommonConfirmRequest = new InteractionRequest <Confirmation>();

            InputNameDialogRequest = new InteractionRequest <ConditionalConfirmation>();

            AssetPickMode = true;
            RootItemId    = null;
        }