Example #1
0
        /// <summary>
        /// Set up commands, do an initial search to populate the list the first time.
        /// </summary>
        public MarketplaceViewModel(WorkflowItem focusedWorkflow)
        {
            downloader = new MarketplaceAssetDownloader(SynchronizationContext.Current, focusedWorkflow);
            this.currentWorkflow = focusedWorkflow;
            SearchCommand = new DelegateCommand((Action)(() =>
            {
                CurrentPage = 1;
                WorkflowsQueryServiceUtility.UsingClient(SearchMarketplaceAssets);
            }));

            DownloadCommand = new DelegateCommand(DownloadExecute,
                () =>
                {
                    return this.ResultList.Any(i => i.IsMarkedForDownload == true) && (!IsBeginDownload);
                });

            CancelDownloadCommand = new DelegateCommand(CancelDownloadExecute, () => { return IsBeginDownload; });

            OpenAssetCommand = new DelegateCommand(this.OpenAssetDetailsCommandExecute, () => { return this.SelectedAssetItem != null; });

            PageChangedCommand = new DelegateCommand(() =>
            {
                WorkflowsQueryServiceUtility.UsingClient(SearchMarketplaceAssets);
            });

            SetDefaultValue();
        }
 public SelectImportAssemblyViewModel(WorkflowItem item)
 {
     this.focusedWorkflow = item;
     this.Title = string.Format("Import Assemblies to Workflow {0}", item.Name);
     this.BrowseCommand = new DelegateCommand(this.BrowseFile);
     this.ImportCommand = new DelegateCommand(this.ImportAssembly);
     this.InitializeAssemblies();
 }
 /// <summary>
 /// constructor
 /// </summary>
 public MarketplaceAssetDownloader(SynchronizationContext uiContext, WorkflowItem focusedWorkflow)
 {
     this.currentDownloadingNumber = 0;
     this.uiContext = uiContext;
     this.currentWorkflow = focusedWorkflow;
 }