public DatabaseSourceRegion(IDbServiceModel model, ModelItem modelItem, enSourceType type) { LabelWidth = 46; ToolRegionName = "DatabaseSourceRegion"; Dependants = new List <IToolRegion>(); NewSourceCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => model.CreateNewSource(type)); EditSourceCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => model.EditSource(SelectedSource, type), CanEditSource); var sources = model.RetrieveSources().OrderBy(source => source.Name); Sources = sources.Where(source => source != null && source.Type == type).ToObservableCollection(); IsEnabled = true; _modelItem = modelItem; SourceId = modelItem.GetProperty <Guid>("SourceId"); SourcesHelpText = Warewolf.Studio.Resources.Languages.HelpText.DatabaseServiceSourceTypesHelp; EditSourceHelpText = Warewolf.Studio.Resources.Languages.HelpText.DatabaseServiceEditSourceHelp; NewSourceHelpText = Warewolf.Studio.Resources.Languages.HelpText.DatabaseServiceNewSourceHelp; SourcesTooltip = Warewolf.Studio.Resources.Languages.Tooltips.ManageDbServiceSourcesTooltip; EditSourceTooltip = Warewolf.Studio.Resources.Languages.Tooltips.ManageDbServiceEditSourceTooltip; NewSourceTooltip = Warewolf.Studio.Resources.Languages.Tooltips.ManageDbServiceNewSourceTooltip; if (SourceId != Guid.Empty) { SelectedSource = Sources.FirstOrDefault(source => source.Id == SourceId); } }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { AddCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand <object>(AddExecute); AddAllCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AddAllExecute); RemoveCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand <object>(RemoveExecute); RemoveAllCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(RemoveAllExecute); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { RedChongCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(RedChongExecute); SearchCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SearchExecute); PayCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(PayExecute); ReverseCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(ReverseExecute);//交易冲正 NewFlushCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(LoadData); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { SearchCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SearchExecute); BillTableCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(BillTableExecute); ProduceFileCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(ProduceFileExecute); UpLoadFileCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(UpLoadFileExecute); SendBillCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SendBillExecute); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { AddUnKnownCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AddUnKnownExecute); RedChongCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(RedChongExecute); SearchCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SearchExecute); DepositCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(DepositExecute); ReverseCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(ReverseExecute); NewFlushCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(LoadData); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { SearchCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SearchExecute); LinkCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(LinkExecute); NewFlushCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(LoadData); AddLinkCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AddLinkExecute); DeleteLinkCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(DeleteLinkExecute); }
public DeployDestinationViewModel(IShellViewModel shellViewModel, IEventAggregator aggregator) : base(shellViewModel, aggregator, false) { ConnectControlViewModel = new ConnectControlViewModel(shellViewModel.LocalhostServer, aggregator, shellViewModel.ExplorerViewModel.ConnectControlViewModel.Servers); ConnectControlViewModel.ServerConnected += async(sender, server) => { await ServerConnected(sender, server); }; ConnectControlViewModel.ServerDisconnected += ServerDisconnected; SelectedEnvironment = _environments.FirstOrDefault(); RefreshCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => RefreshEnvironment(SelectedEnvironment.ResourceId)); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { AddCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AddExecute); ModifyCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(ModifyExecute); SearchCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SearchExecute); DeleteCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(DeleteExecute); AuthorizeCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AuthorizeExecute); NewFlushCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(LoadData); DutyMaintainList = new ObservableCollection <DutyModel>(); }
//private ListMenuItem _bpMenuListItem; protected BusinessProcessViewModelBase() { DenyBusinessProcessTrigger = false; BusinessProcessCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand <BusinessProcessCommandParameter>(OnBPExecute, CanBPExecute); LoadBPMenuItemsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand <BusinessProcessCommandParameter>(OnLoadBPMenuItems, CanLoadBPMenuItems); EmptyCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand <BusinessProcessCommandParameter>(OnDoNothing, CanDoNothing); CreateMenu(); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { AddCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AddExecute); ModifyCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(ModifyExecute); SearchCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SearchExecute); DeleteCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(DeleteExecute); AuthorizeCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AuthorizeExecute); NewFlushCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(LoadData); LockCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(LockExecute); UserMaintainList = new ObservableCollection <FundsRegulatoryClient.UserManageSrv.UserInfo>(); }
public ObservableAwareNameValue(ObservableCollection <INameValue> sourceCollection, Action <string> update) { _sourceCollection = sourceCollection; _update = update; Name = ""; Value = ""; AddRowCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AddRow); RemoveRowCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(RemoveRow); }
public ObservableAwareNameValue(ObservableCollection <INameValue> sourceCollection, Action <string> update) { _sourceCollection = sourceCollection; _update = update; // ReSharper disable DoNotCallOverridableMethodsInConstructor Name = ""; Value = ""; AddRowCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(AddRow); RemoveRowCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(RemoveRow); // ReSharper restore DoNotCallOverridableMethodsInConstructor }
public DropBoxDownloadViewModel(ModelItem modelItem, IDropboxSourceManager sourceManager) : base(modelItem, "File Or Folder", String.Empty) { _sourceManager = sourceManager; EditDropboxSourceCommand = new RelayCommand(o => EditDropBoxSource(), p => IsDropboxSourceSelected); NewSourceCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(CreateOAuthSource); // ReSharper disable once VirtualMemberCallInContructor Sources = LoadOAuthSources(); AddTitleBarLargeToggle(); EditDropboxSourceCommand.RaiseCanExecuteChanged(); HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_Dropbox_Download; }
public DataListViewModel(IEventAggregator eventPublisher) : base(eventPublisher) { ClearSearchTextCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => SearchText = ""); ViewSortDelete = true; Provider = new Dev2TrieSugggestionProvider(); _missingDataList = new MissingDataList(RecsetCollection, ScalarCollection); _partIsUsed = new PartIsUsed(RecsetCollection, ScalarCollection, ComplexObjectCollection); _complexObjectHandler = new ComplexObjectHandler(this); _scalarHandler = new ScalarHandler(this); _recordsetHandler = new RecordsetHandler(this); _helper = new DataListViewModelHelper(this); }
public MyAssetsViewModel() { using (var uow = new UnitOfWork()) { User = uow.UserRepository.GetById(Logic.UserContext.Current.UserId); var assetHepler = new AssetHelper(User.Id); var assets = assetHepler.GetAssets(); Assets = new ObservableCollection <AssetViewModel>(assets); } AddTransactionCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand <AssetViewModel>(OnAddTransactionClick); AddAssetCommand = new DelegateCommand(OnAddAsset); NavigateToTransactionList = new DelegateCommand <AssetViewModel>(OnNavigateToTransactionList); NavigateToDeleteTransaction = new Microsoft.Practices.Prism.Commands.DelegateCommand <AssetViewModel>(OnNavigateToDeleteTransaction); }
public DropBoxFileListDesignerViewModel(ModelItem modelItem, IDropboxSourceManager sourceManager) : base(modelItem) { _sourceManager = sourceManager; EditDropboxSourceCommand = new RelayCommand(o => EditDropBoxSource(), p => IsDropboxSourceSelected); NewSourceCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(CreateOAuthSource); Sources = LoadOAuthSources(); AddTitleBarLargeToggle(); EditDropboxSourceCommand.RaiseCanExecuteChanged(); IsFilesSelected = true; IncludeDeleted = false; IsRecursive = false; IncludeMediaInfo = false; HelpText = Warewolf.Studio.Resources.Languages.HelpText.Tool_Dropbox_List_Contents; }
public ManageWcfSourceViewModel(IWcfSourceModel updateManager, IEventAggregator aggregator, IAsyncWorker asyncWorker, IServer environment) : base("WcfSource") { VerifyArgument.IsNotNull("asyncWorker", asyncWorker); VerifyArgument.IsNotNull("updateManager", updateManager); VerifyArgument.IsNotNull("aggregator", aggregator); AsyncWorker = asyncWorker; _environment = environment; _updateManager = updateManager; _endPointUrl = string.Empty; HeaderText = Resources.Languages.Core.WcfServiceNewHeaderLabel; Header = Resources.Languages.Core.WcfServiceNewHeaderLabel; TestCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(TestConnection, CanTest); SaveCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SaveConnection, CanSave); CancelTestCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(CancelTest, CanCancelTest); }
public DeploySourceExplorerViewModel(IShellViewModel shellViewModel, Microsoft.Practices.Prism.PubSubEvents.IEventAggregator aggregator, IDeployStatsViewerViewModel statsArea, IEnvironmentViewModel selectedEnvironment) { if (shellViewModel == null) { throw new ArgumentNullException(nameof(shellViewModel)); } var localhostEnvironment = CreateEnvironmentFromServer(shellViewModel.LocalhostServer, shellViewModel); _shellViewModel = shellViewModel; _selectAction = SelectAction; _selectedEnv = selectedEnvironment; Environments = new ObservableCollection <IEnvironmentViewModel> { localhostEnvironment }; LoadLocalHostEnvironment(localhostEnvironment); ConnectControlViewModel = new ConnectControlViewModel(_shellViewModel.LocalhostServer, aggregator, _shellViewModel.ExplorerViewModel.ConnectControlViewModel.Servers); ShowConnectControl = true; ConnectControlViewModel.ServerDisconnected += ServerDisconnected; _statsArea = statsArea; foreach (var environmentViewModel in _environments) { environmentViewModel.SelectAction = SelectAction; } if (ConnectControlViewModel.SelectedConnection != null && !ConnectControlViewModel.SelectedConnection.IsLocalHost) { UpdateItemForDeploy(ConnectControlViewModel.SelectedConnection.EnvironmentID); } IsRefreshing = false; ShowConnectControl = false; RefreshCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => RefreshEnvironment(SelectedEnvironment.ResourceId)); ConnectControlViewModel.SelectedEnvironmentChanged += ConnectControlSelectedExplorerEnvironmentChanged; ConnectControlViewModel.ServerConnected += (sender, server) => { IsDeployLoading = true; ServerConnectedAsync(server).ContinueWith(t => { IsDeployLoading = false; }, TaskContinuationOptions.ExecuteSynchronously); }; IsDeploy = true; }
public DotNetConstructorRegion(IPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IPluginSource> source, INamespaceToolRegion <INamespaceItem> namespaceItem) { try { Errors = new List <string>(); LabelWidth = 70; ToolRegionName = "DotNetConstructorRegion"; _modelItem = modelItem; _model = model; _source = source; _namespace = namespaceItem; _namespace.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; if (_source.SelectedSource != null) { Constructors = model.GetConstructors(_source.SelectedSource, _namespace.SelectedNamespace); } if (Method != null && Constructors != null) { SelectedConstructor = Constructors.FirstOrDefault(constructor => constructor.ConstructorName == Method.ConstructorName); } RefreshConstructorsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { Constructors = model.GetConstructors(_source.SelectedSource, _namespace.SelectedNamespace); } IsRefreshing = false; }, CanRefresh); IsConstructorExpanded = false; IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }
// public ClassViewModel() { RelationPropertyAStructChangedCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(RelationPropertyAStructChanged); RelationPropertyBStructChangedCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(RelationPropertyBStructChanged); DesignClass = new DesignClass(); DesignClass.ClassID = -1; DesignClass.State = "added"; ListCollectionView listCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(ApplicationDesignCache.NamespaceSource); listCollectionView.SortDescriptions.Add(new SortDescription("NamespaceName", ListSortDirection.Ascending)); NamespaceSource = ApplicationDesignCache.NamespaceSource; SelectedNameSpace = ApplicationDesignCache.NamespaceSource.Where(item => item.NamespaceID == 55).FirstOrDefault(); listCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(ApplicationDesignCache.StructSource); listCollectionView.SortDescriptions.Add(new SortDescription()); StructSource = ApplicationDesignCache.StructSource; RelationPropertyAStructSource = ApplicationDesignCache.StructSource; RelationPropertyBStructSource = ApplicationDesignCache.StructSource; IsEnableBaseClass = false; }
public DotNetMethodRegion(IPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IPluginSource> source, INamespaceToolRegion <INamespaceItem> namespaceItem) : this(CustomContainer.Get <IShellViewModel>(), new ActionInputDatatalistMapper()) { try { Errors = new List <string>(); LabelWidth = 70; ToolRegionName = "DotNetMethodRegion"; _modelItem = modelItem; _model = model; _source = source; _namespace = namespaceItem; _namespace.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; if (_source.SelectedSource != null) { MethodsToRun = model.GetActionsWithReturns(_source.SelectedSource, _namespace.SelectedNamespace); } if (Method != null && MethodsToRun != null) { SelectedMethod = Method; } RefreshMethodsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { MethodsToRun = model.GetActionsWithReturns(_source.SelectedSource, _namespace.SelectedNamespace); } IsRefreshing = false; }, CanRefresh); IsMethodExpanded = false; IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }
public ComActionRegion(IComPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IComPluginSource> source, INamespaceToolRegion <INamespaceItem> namespaceItem) { try { Errors = new List <string>(); LabelWidth = 70; ToolRegionName = "ComActionRegion"; _modelItem = modelItem; _model = model; _source = source; _namespace = namespaceItem; _namespace.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; if (_source.SelectedSource != null) { Actions = model.GetActions(_source.SelectedSource, _namespace.SelectedNamespace); } if (Method != null && Actions != null) { IsActionEnabled = true; SelectedAction = Actions.FirstOrDefault(action => action.Method == Method.Method); } RefreshActionsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { Actions = model.GetActions(_source.SelectedSource, _namespace.SelectedNamespace); } IsRefreshing = false; }, CanRefresh); IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }
public SharepointServerSourceViewModel(ISharePointSourceModel updateManager, IEventAggregator aggregator, IAsyncWorker asyncWorker, IServer environment) : base("SharepointServerSource") { VerifyArgument.IsNotNull("asyncWorker", asyncWorker); VerifyArgument.IsNotNull("updateManager", updateManager); VerifyArgument.IsNotNull("aggregator", aggregator); AsyncWorker = asyncWorker; _environment = environment; _updateManager = updateManager; _authenticationType = AuthenticationType.Windows; _serverName = string.Empty; _userName = string.Empty; _password = string.Empty; IsWindows = true; HeaderText = Resources.Languages.Core.SharePointServiceNewHeaderLabel; Header = Resources.Languages.Core.SharePointServiceNewHeaderLabel; TestCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(TestConnection, CanTest); SaveCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SaveConnection, CanSave); CancelTestCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(CancelTest, CanCancelTest); }
public WcfActionRegion(IWcfServiceModel model, ModelItem modelItem, ISourceToolRegion <IWcfServerSource> source) { try { Errors = new List <string>(); LabelWidth = 46; ToolRegionName = "DbActionRegion"; _modelItem = modelItem; _model = model; _source = source; _source.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; if (_source.SelectedSource != null) { Actions = model.GetActions(_source.SelectedSource); } if (!string.IsNullOrEmpty(Method.FullName)) { IsActionEnabled = true; SelectedAction = Actions.FirstOrDefault(action => action.FullName == Method.FullName); } RefreshActionsCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { Actions = model.GetActions(_source.SelectedSource); } IsRefreshing = false; }, CanRefresh); IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }
public DeploySourceExplorerViewModel(IShellViewModel shellViewModel, Microsoft.Practices.Prism.PubSubEvents.IEventAggregator aggregator, IDeployStatsViewerViewModel statsArea) { if (shellViewModel == null) { throw new ArgumentNullException(nameof(shellViewModel)); } var localhostEnvironment = CreateEnvironmentFromServer(shellViewModel.LocalhostServer, shellViewModel); _shellViewModel = shellViewModel; _selectAction = SelectAction; // ReSharper disable once VirtualMemberCallInContructor Environments = new ObservableCollection <IEnvironmentViewModel> { localhostEnvironment }; // ReSharper disable once VirtualMemberCallInContructor LoadEnvironment(localhostEnvironment); ConnectControlViewModel = new ConnectControlViewModel(_shellViewModel.LocalhostServer, aggregator, _shellViewModel.ExplorerViewModel.ConnectControlViewModel.Servers); ShowConnectControl = true; ConnectControlViewModel.ServerConnected += async(sender, server) => { await ServerConnected(sender, server); }; ConnectControlViewModel.ServerDisconnected += ServerDisconnected; _statsArea = statsArea; foreach (var environmentViewModel in _environments) { environmentViewModel.SelectAction = SelectAction; } if (ConnectControlViewModel.SelectedConnection != null) { UpdateItemForDeploy(ConnectControlViewModel.SelectedConnection.EnvironmentID); } IsRefreshing = false; ShowConnectControl = false; RefreshCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => RefreshEnvironment(SelectedEnvironment.ResourceId)); ConnectControlViewModel.SelectedEnvironmentChanged += async(sender, id) => { await DeploySourceExplorerViewModelSelectedEnvironmentChanged(sender, id); }; IsDeploy = true; }
public DotNetNamespaceRegion(IPluginServiceModel model, ModelItem modelItem, ISourceToolRegion <IPluginSource> source) { try { Errors = new List <string>(); LabelWidth = 74; ToolRegionName = "DotNetNamespaceRegion"; _modelItem = modelItem; _model = model; _source = source; _source.SomethingChanged += SourceOnSomethingChanged; Dependants = new List <IToolRegion>(); IsRefreshing = false; UpdateBasedOnSource(); if (Namespace != null) { SelectedNamespace = Namespaces.FirstOrDefault(item => item.FullName == Namespace.FullName); } RefreshNamespaceCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => { IsRefreshing = true; if (_source.SelectedSource != null) { Namespaces = _modelItem.ItemType == typeof(DsfEnhancedDotNetDllActivity) ? _model.GetNameSpacesWithJsonRetunrs(_source.SelectedSource) : _model.GetNameSpaces(_source.SelectedSource); } IsRefreshing = false; }, CanRefresh); IsEnabled = true; _modelItem = modelItem; } catch (Exception e) { Errors.Add(e.Message); } }
public TestViewModel() { PrismDelegate = new Microsoft.Practices.Prism.Commands.DelegateCommand(Execute, CanExecute); MyDelegate = new DelegateCommandWrapper(Execute, CanExecute); MyDelegateFromFactory = new DelegateCommandFactory().CreateCommand(Execute, CanExecute); }
protected ExplorerViewModelBase() { RefreshCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(async() => await RefreshAsync(true).ConfigureAwait(true)); ClearSearchTextCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(() => SearchText = ""); CreateFolderCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(CreateFolder); }
public LoginViewModel(IChatHubProxy proxy, IRegionManager rm) { _proxy = proxy; Login = new DelegateCommand(async () => { IsLoggingIn = true; try { await proxy.Login(Username); } finally { IsLoggingIn = false; } }, () => IsConnected && !IsLoggingIn && !String.IsNullOrWhiteSpace(Username)); proxy.Connected = (detail, details) => rm.RequestNavigate(RegionNames.MainRegion, new Uri("ChatView", UriKind.Relative)); Reconnect = new DelegateCommand(async () => await Connect(), () => !IsConnected && !IsConnecting); Reconnect.Execute(); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { SearchCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(SearchExecute); }
/// <summary> /// 加载命令 /// </summary> public override void LoadCommand() { OKCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(OkExecute); DutyAllocateCommand = new Microsoft.Practices.Prism.Commands.DelegateCommand(DutyAllocateExecute); WebsiteList = WebsiteClient.Selects(); }