• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# System.DelegateCommand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.DelegateCommand的典型用法代码示例。如果您正苦于以下问题:C# DelegateCommand类的具体用法?C# DelegateCommand怎么用?C# DelegateCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DelegateCommand类属于System命名空间,在下文中一共展示了DelegateCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: QueryViewModel

		public QueryViewModel(ItemFilter item)
		{
			InnerItem = item;

			QueryHelpCommand = new DelegateCommand(RaiseQueryHelpInteractionRequest);
			QueryCheckCommand = new DelegateCommand(RaiseQueryCheckInteractionRequest);
		}
开发者ID:gitter-badger,项目名称:vc-community-1.x,代码行数:7,代码来源:QueryViewModel.cs


示例2: TriggerForkedStatementData

 public TriggerForkedStatementData()
 {
     _addStatementCommand = new DelegateCommand<string>(
           (s) => { AddStatement(); }, //Execute
           (s) => { return true; } //CanExecute
           );
 }
开发者ID:Rekve,项目名称:Logic-Analyzer-Triggering,代码行数:7,代码来源:TriggerForkedStatementData+(NO-L-R9EHM40s+kopi+som+er+i+konflikt+2015-05-26+(40)).cs


示例3: BasicAuthorizationSetupViewModel

 public BasicAuthorizationSetupViewModel(ViewModel parent, string prompt)
   : base(parent)
 {
   Prompt = prompt;
   RegisterCommand(OkCommand = new DelegateCommand<object>(Ok));
   RegisterCommand(CancelCommand = new DelegateCommand<object>(Cancel));
 }
开发者ID:paulswartz,项目名称:Mason,代码行数:7,代码来源:BasicAuthorizationSetupViewModel.cs


示例4: PickAssetViewModel

		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;
		}
开发者ID:gitter-badger,项目名称:vc-community-1.x,代码行数:25,代码来源:PickAssetViewModel.cs


示例5: TriggerVm

        public TriggerVm(Trigger trigger, IEnumerable<Signal> avalibleSignals)
        {
            IS_SAVED = false;
            _trigger = trigger;
            _avalibleSignals = avalibleSignals;

            //Testing
            var triggerstatedata = new TriggerStateData(_avalibleSignals);
            var statement = new Statement.Equals(new Signal() { Name = "A1" }, 0);
            triggerstatedata.StateNumber = 1;

            //The trigger will always start with one state initially
            _triggerStateDatas = new List<TriggerStateData>();
            _triggerStateDatas.Add(triggerstatedata);

            ObservableTriggerStates = new ListCollectionView(_triggerStateDatas);

            _saveCommand = new DelegateCommand<string>(
                     (s) => { SaveTrigger(); }, //Execute
                     (s) => { return _canSave; } //CanExecute
                     );
            _saveCommand = new DelegateCommand<string>(
                    (s) => { SaveTrigger(); }, //Execute
                    (s) => { return _canSave; } //CanExecute
                    );

            _saveCommand = new DelegateCommand<string>(
                    (s) => { SaveTrigger(); }, //Execute
                    (s) => { return _canSave; } //CanExecute
                    );
        }
开发者ID:Rekve,项目名称:Logic-Analyzer-Triggering,代码行数:31,代码来源:TriggerVm+(NO-L-R9EHM40s+kopi+som+er+i+konflikt+2015-05-26+(9)).cs


示例6: TriggerVm

        public TriggerVm(Trigger trigger, IEnumerable<Signal> avalibleSignals)
        {
            IS_SAVED = false;
            _trigger = trigger;
            _avalibleSignals = avalibleSignals;

            //The trigger will always start with one state initially
            _triggerStateDatas = new List<TriggerStateDataModel>();
            _triggerStateDatas.Add(new TriggerStateDataModel(_avalibleSignals));

            ObservableTriggerStates = new ListCollectionView(_triggerStateDatas);

            _saveCommand = new DelegateCommand<string>(
                     (s) => { SaveTrigger(); }, //Execute
                     (s) => { return true; } //CanExecute
                     );

            _addCommand = new DelegateCommand<string>(
                    (s) => { AddState(); }, //Execute
                    (s) => { return true; } //CanExecute
                    );

            _removeCommand = new DelegateCommand<string>(
                    (s) => { RemoveState(); }, //Execute
                    (s) => { return true; } //CanExecute
                    );
        }
开发者ID:Rekve,项目名称:Logic-Analyzer-Triggering,代码行数:27,代码来源:TriggerVm+(NO-L-R9EHM40s+kopi+som+er+i+konflikt+2015-05-26+(25)).cs


示例7: UnitViewModel

        public UnitViewModel(AppConfig config, MainViewModel mvm)
        {
            m_config = config;
            m_mvm = mvm;

            SendToSlotCommand = new DelegateCommand<string>(SendToSlot, x => SelectedIdol != null);
            SaveCommand = new DelegateCommand(Save, () => !string.IsNullOrEmpty(UnitName));
            DeleteCommand = new DelegateCommand(Delete, () => Units.Contains(SelectedUnit));
            MoveToSlotCommand = new DelegateCommand<string>(MoveToSlot, CanMoveToSlot);
            ResetSlotCommand = new DelegateCommand<string>(ResetSlot, CanResetSlot);
            HighlightCommand = new DelegateCommand<string>(Highlight, CanHighlight);
            CopyIidCommand = new DelegateCommand(CopyIid, () => SelectedIdol != null);
            SetGuestCenterCommand = new DelegateCommand(SetGuestCenter, () => SelectedIdol != null);
            CopyIidFromSlotCommand = new DelegateCommand<string>(CopyIidFromSlot);
            SetGuestCenterFromSlotCommand = new DelegateCommand<string>(SetGuestCenterFromSlot);

            Idols = new ListCollectionView(m_config.OwnedIdols);
            Filter = new IdolFilter(config, Idols, false);
            Filter.SetConfig(config.UnitIdolFilterConfig);

            Units = m_config.Units;

            TemporalUnit = new Unit();
            SelectedUnit = Units.FirstOrDefault();

            foreach (var option in config.UnitIdolSortOptions)
            {
                Idols.SortDescriptions.Add(option.ToSortDescription());
            }
        }
开发者ID:noelex,项目名称:Cindeck,代码行数:30,代码来源:UnitViewModel.cs


示例8: ViewInvitesViewModel

        public ViewInvitesViewModel(MainViewModel parent, IMobileServiceTable<Invite> invitesTable, Action dismiss)
        {
            _parent = parent;
            _invitesTable = invitesTable;
            Invites = parent.Invites;

            AcceptCommand = new DelegateCommand<Invite>(async invite =>
            {
                invite.Approved = true;
                await _invitesTable.UpdateAsync(invite);
                Invites.Remove(invite);
                _parent.LoadLists();
                _parent.ViewInvitesCommand.IsEnabled = Invites.Count > 0;
                if (Invites.Count == 0 )
                {
                    dismiss();
                }
            });

            RejectCommand = new DelegateCommand<Invite>(async invite =>
            {
                await _invitesTable.UpdateAsync(invite);
                Invites.Remove(invite);
                _parent.ViewInvitesCommand.IsEnabled = Invites.Count > 0;
                if (Invites.Count == 0)
                {
                    dismiss();
                }
            });
        }
开发者ID:TroyBolton,项目名称:azure-mobile-services,代码行数:30,代码来源:ViewInvitesViewModel.cs


示例9: MainPageViewModel

        public MainPageViewModel(INavigationService navigationService, IEventAggregator eventAggregator)
        {
            _navigationService = navigationService;
            _eventAggregator = eventAggregator;

            NavigateCommand = new DelegateCommand(Navigate);
        }
开发者ID:ruxo,项目名称:Prism,代码行数:7,代码来源:MainPageViewModel.cs


示例10: ReservationsViewModel

        public ReservationsViewModel(IServiceFactory serviceFactory)
        {
            _ServiceFactory = serviceFactory;

            ExecuteRentalCommand = new DelegateCommand<int>(OnExecuteRentalCommandExecute);
            CancelReservationCommand = new DelegateCommand<int>(OnCancelReservationCommandExecute);
        }
开发者ID:colinmacritchie,项目名称:CarRental,代码行数:7,代码来源:ReservationsViewModel.cs


示例11: InitCommands

		private void InitCommands()
		{
			StartFtpCommand = new DelegateCommand(StartFtp);
			ProcessFilesCommand = new DelegateCommand(FindAll);
			FindByCaseNumberCommand = new DelegateCommand(FindByCaseNumber);
			ValidateCommand = new DelegateCommand(Validate);
		}
开发者ID:mishustin,项目名称:GlovisRus_Utils,代码行数:7,代码来源:ViewModel.cs


示例12: MobileTransactionsViewModel

        public MobileTransactionsViewModel(MainViewModel mainViewModel)
        {
            _mainViewModel = mainViewModel;

            FromDateFilter = DateTime.Today.AddDays(-14);
            ThroughDateFilter = DateTime.Today.AddDays(1);

            SalesmanFilter = mainViewModel.Context.Salesmen.ToList();
            SalesmanFilter.Insert(0, new Salesman { Contragent = new Contragent { LastName = "Any" } });
            SelectedSalesmanFilter = SalesmanFilter.FirstOrDefault();

            //ClientsFilter = mainViewModel.Context.Clients.ToList().Select(x => x.Contragent).ToList();
            //ClientsFilter.Insert(0, new Contragent { LastName = "Any" });
            //SelectedClientFilter = ClientsFilter.FirstOrDefault();

            ClientsFilter = mainViewModel.Context.Clients.ToList().Select(x => x.Contragent.LastName).ToList();

            MobileTransactions = new ObservableCollection<MobileTransactionViewModel>(GetMobileTransactions(mainViewModel.Context));
            MobileTransactionsView = CollectionViewSource.GetDefaultView(MobileTransactions);
            MobileTransactionsView.Filter = Filter;

            AddCommand = new DelegateCommand(Add);
            CloseAddDialogCommand = new DelegateCommand(() => AddDialogViewModel = null);

            DeleteCommand = new DelegateCommand(Delete, () => SelectedTransaction != null);

            FilterCommand = new DelegateCommand(MobileTransactionsView.Refresh);
        }
开发者ID:didovych,项目名称:BroWPF,代码行数:28,代码来源:MobileTransactionsViewModel.cs


示例13: MainWindowViewModel

 public MainWindowViewModel()
 {
     OKButtonCommand = new DelegateCommand(OKButton);
     EmployeeCollection = new ObservableCollection<Employee>();
     PositionsCollection = Enum.GetValues(typeof(Positions)).Cast<Positions>();
     SelectedBirthDate = new DateTime(1970, 1, 1);
 }
开发者ID:ricardb,项目名称:UOC_IngSoftware,代码行数:7,代码来源:MainWindowViewModel.cs


示例14: PageStartMenuViewModel

 public PageStartMenuViewModel(IRegionManager regionManager, ITaskDialogService taskDialog)
 {
     _regionManager = regionManager;
     _taskDialog = taskDialog;
     NavigateCommand = new DelegateCommand<Uri>(Navigate);
     ExitCommand = new DelegateCommand<Window>(ExitGame);
 }
开发者ID:TheAirlineProject,项目名称:tap-desktop,代码行数:7,代码来源:PageStartMenuViewModel.cs


示例15: Init

		private void Init(Model model) {
			OnCompleted += () => {
				disposables.Dispose();
			};
			CancelCommand = new DelegateCommand(
				() => {
					Success(new Result.Cancel());
				},
				() => true
			);
			UploadCommand = new DelegateCommand(
				() => {
					model.certificate.certificateID = certificateNameValue.Text;
					Success(new Result.Upload());
				},
				() => true
			);

			InitializeComponent();

			certificateDetails.Text = CertificateToString(model.certificate);
			certificateNameValue.Text = CertificateNum(model.certificate);

			certificateNameCaption.CreateBinding(TextBlock.TextProperty, Strings, s => s.enterName);
			btnCancel.CreateBinding(Button.ContentProperty, ButtonsLocales, s => s.cancel);
			btnUpload.CreateBinding(Button.ContentProperty, Strings, s => s.uploadCertificate);
			captionDetails.CreateBinding(TextBlock.TextProperty, Strings, s => s.details);
		}
开发者ID:zzilla,项目名称:ONVIF-Device-Manager,代码行数:28,代码来源:CertificateUploadView.xaml.cs


示例16: MainPageViewModel

 public MainPageViewModel(INavigationService navigationService, IPageDialogService dialogService)
 {
     CommandLogarFacebook = new DelegateCommand(LogarFacebook);
     CommandLogar = new DelegateCommand(Autenticar);
     _navigationService = navigationService;
     _dialogservice = dialogService;
 }
开发者ID:bruno-wladimir,项目名称:Faculdade,代码行数:7,代码来源:MainPageViewModel.cs


示例17: TreeCatalogViewModel

        public TreeCatalogViewModel(
            IViewModelsFactory<ICatalogViewModel> vmFactory,
            catalogModel.Catalog item,
            IRepositoryFactory<ICatalogRepository> repositoryFactory,
            IAuthenticationContext authContext,
            INavigationManager navigationManager,
            IViewModelsFactory<ICatalogDeleteViewModel> catalogDeleteVmFactory,
            IViewModelsFactory<ITreeCategoryViewModel> treeCategoryVmFactory,
            IDataManagementService exportService)
            : base(repositoryFactory, authContext)
        {
            InnerItem = item;
            EmbeddedHierarchyEntry = this;

            _catalogDeleteVmFactory = catalogDeleteVmFactory;
            _treeCategoryVmFactory = treeCategoryVmFactory;
            _exportService = exportService;

            OpenItemCommand = new DelegateCommand(() =>
            {
                if (NavigationData == null)
                {
                    var editVM = vmFactory.GetViewModelInstance(new KeyValuePair<string, object>("item", InnerItem)
                        , new KeyValuePair<string, object>("parentTreeVM", this));
                    NavigationData = ((IClosable)editVM).NavigationData;
                }
                navigationManager.Navigate(NavigationData);
            });

            ExportItemCommand = new DelegateCommand(() => RaiseExportItemCommand());
        }
开发者ID:gitter-badger,项目名称:vc-community-1.x,代码行数:31,代码来源:TreeCatalogViewModel.cs


示例18: MainWindowViewModel

        public MainWindowViewModel()
        {
            startCommand = new DelegateCommand(StartService, CanStartService);
            stopCommand = new DelegateCommand(StopService, CanStopService);
            restartCommand = new DelegateCommand(RestartService, CanStopService);
            saveCommand = new DelegateCommand(SaveAndExit, CanFindServiceConfiguration);
            applyCommand = new DelegateCommand(SaveConfiguration, CanFindServiceConfiguration);
            cancelCommand = new DelegateCommand(OnCloseRequested);

            statusUpdateWorker.DoWork += UpdateServiceStatus;
            statusUpdateWorker.RunWorkerCompleted += DisplayNewStatus;

            // TODO: Dynamically determine service name
            service = new ServiceController("EmanateService");
            try
            {
                Status = service.DisplayName + " service is installed";
                serviceIsInstalled = true;
            }
            catch (Exception)
            {
                Status = "Service is not installed";
                serviceIsInstalled = false;
            }

            pluginConfigurationStorer = new PluginConfigurationStorer();
            ConfigurationInfos = new ObservableCollection<ConfigurationInfo>();
        }
开发者ID:Falconne,项目名称:Emanate,代码行数:28,代码来源:MainWindowViewModel.cs


示例19: MainFulfillmentViewModel

		public MainFulfillmentViewModel(
			IInventoryHomeViewModel inventoryVm, 
			IPicklistHomeViewModel picklistVm, 
			IRmaHomeViewModel rmaVm, 
			IViewModelsFactory<ICompleteShipmentViewModel> completeShipmentVmFactory,
			IRepositoryFactory<IOrderRepository> orderRepositoryFactory,
			IOrderService orderService,
			IAuthenticationContext authContext)
        {
            ViewTitle = new ViewTitleBase { Title = "Fulfillment", SubTitle = "FULFILLMENT SERVICE" };
			_inventoryHomeVm = inventoryVm;
			_inventoryHomeVm.ParentViewModel = this;
			
			_picklistHomeVm = picklistVm;
			_picklistHomeVm.ParentViewModel = this;

			_rmaHomeVm = rmaVm;
			_rmaHomeVm.ParentViewModel = this;

			_completeShipmentVmFactory = completeShipmentVmFactory;
			_orderRepositoryFactory = orderRepositoryFactory;
			_authContext = authContext;

			_orderService = orderService;

			PopulateTabItems();
			CompleteShipmentCommand = new DelegateCommand(RaiseCompleteShipment);
			CommonConfirmRequest = new InteractionRequest<Confirmation>();
			CommonNotifyRequest = new InteractionRequest<Notification>();
        }
开发者ID:karpinskiy,项目名称:vc-community,代码行数:30,代码来源:MainFulfillmentViewModel.cs


示例20: MyViewModel

        public MyViewModel()
        {
            //ll = 100;
            _sensors = new ObservableCollection<sensor>();
            _bacnet = new BacNet("10.81.32.211");
            _bacnet.NetworkModelChangedEvent += OnNetworkModelChanged;
            Thread.Sleep(100);

            SetValueCommand = new DelegateCommand(SetValue);
            GetValueCommand = new DelegateCommand(GetValue);

            var tmpList = new List<uint>();
            tmpList.Add(1100);
            tmpList.Add(1200);
            tmpList.Add(1400);
            tmpList.Add(1500);

            //_bacnet.FindSeveral(tmpList);
            //var tmp = _bacnet[1600].Objects["BI1101"].Get();
            _bacnet[1400].Objects["BI1102"].ValueChangedEvent += OnBacnetValueChanged;
            _bacnet[1400].Objects["BV1102"].ValueChangedEvent += OnBacnetValueChanged;
            SchValues = new List<string>();
            object obj = _bacnet[17811].Objects["AO1104"].Get();
            ll = obj.ToString();

            TestDali();
        }
开发者ID:kib357,项目名称:webApiServer,代码行数:27,代码来源:MyViewModel.cs



注:本文中的System.DelegateCommand类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# System.DomainName类代码示例发布时间:2022-05-26
下一篇:
C# System.Delegate类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap