當前位置: 首頁>>代碼示例>>C#>>正文


C# Input.DelegateCommand類代碼示例

本文整理匯總了C#中System.Windows.Input.DelegateCommand的典型用法代碼示例。如果您正苦於以下問題:C# DelegateCommand類的具體用法?C# DelegateCommand怎麽用?C# DelegateCommand使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DelegateCommand類屬於System.Windows.Input命名空間,在下文中一共展示了DelegateCommand類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BattlesViewModel

 public BattlesViewModel()
 {
     AddActionCommand = new DelegateCommand(AddAction);
     DeleteActionCommand = new DelegateCommand(DeleteAction);
     ClearActionsCommand = new DelegateCommand(ClearActions);
     ViewName = "Battles";
 }
開發者ID:EasyFarm,項目名稱:EasyFarm,代碼行數:7,代碼來源:BattlesViewModel.cs

示例2: ComplexCustomViewViewModel

        public ComplexCustomViewViewModel( Model model )
        {
            Model = model;

            ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
            ConfirmationRequest = new InteractionRequest<INotification>();
        }
開發者ID:JackWangCUMT,項目名稱:Plainion,代碼行數:7,代碼來源:ComplexCustomViewViewModel.cs

示例3: AddEditPropertyListNameViewModel

        public AddEditPropertyListNameViewModel(AddEditPropertyListNameDialog view, PropertyListName propertyListName, CommonUtils.Operation operation)
        {
            View = view;
            mPropertyListName = propertyListName;

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanModifyConfig);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);

            if (operation == CommonUtils.Operation.Update)
            {
                CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

                cmsWebServiceClient.GetPropertyListNameCompleted +=
                    (s1, e1) =>
                    {
                        mPropertyListName = e1.Result;
                        LoadPropertyListNames(mPropertyListName.PropertyListId);
                        mExistingPropertyListNamesLoaded = true;
                        FireLoaded();
                    };
                cmsWebServiceClient.GetPropertyListNameAsync(mPropertyListName.Id);
            }
            else
            {
                LoadPropertyListNames(mPropertyListName.PropertyListId);
            }
        }
開發者ID:barrett2474,項目名稱:CMS2,代碼行數:27,代碼來源:AddEditPropertyListNameViewModel.cs

示例4: CredentialModelView

 public CredentialModelView()
 {
     Users = new ObservableCollection<CredentialUser>();
     RefreshCommand = new DelegateCommand(RefreshUsers);
     SaveCommand = new DelegateCommand<PasswordBox>(SaveObject);
     RefreshUsers();
 }
開發者ID:tablesmit,項目名稱:CredentialChanger,代碼行數:7,代碼來源:CredentialModelView.cs

示例5: FlyoutService

        public FlyoutService(IRegionManager regionManager, IApplicationCommands applicationCommands)
        {
            _regionManager = regionManager;

            ShowFlyoutCommand = new DelegateCommand<string>(ShowFlyout, CanShowFlyout);
            applicationCommands.ShowFlyoutCommand.RegisterCommand(ShowFlyoutCommand);
        }
開發者ID:steve600,項目名稱:VersatileMediaManager,代碼行數:7,代碼來源:FlyoutService.cs

示例6: AddEditMobilePlantComponentTypeViewModel

        public AddEditMobilePlantComponentTypeViewModel(MobilePlantComponentType mct)
        {
            mMobilePlantComponentType = mct;

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanModifyConfig);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
        }
開發者ID:barrett2474,項目名稱:CMS2,代碼行數:7,代碼來源:AddEditMobilePlantComponentTypeViewModel.cs

示例7: RegionWithPopupWindowActionExtensionsViewModel

        public RegionWithPopupWindowActionExtensionsViewModel( Model model )
        {
            Model = model;

            ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
            ConfirmationRequest = new InteractionRequest<INotification>();
        }
開發者ID:JackWangCUMT,項目名稱:Plainion,代碼行數:7,代碼來源:RegionWithPopupWindowActionExtensionsViewModel.cs

示例8: ShellViewModel

        public ShellViewModel()
        {
            SetVisibilityOfNavigationBack();
            SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested;

            OpenPaneCommand = new DelegateCommand(OpenPaneCommandDelegate);
        }
開發者ID:GeekyTheory,項目名稱:GeekyBlogs,代碼行數:7,代碼來源:ShellViewModel.cs

示例9: MainWindow

 public MainWindow()
 {
     InitializeComponent();
     OpenHelpPageCommand = new DelegateCommand(ExecuteOpenHelpPage);
     this.DataContext = OpenHelpPageCommand;
     this.InputBindings.Add(new KeyBinding(this.OpenHelpPageCommand, new KeyGesture(Key.F1)));
 }
開發者ID:NathanEWhitaker,項目名稱:xaml-sdk,代碼行數:7,代碼來源:MainWindow.xaml.cs

示例10: WeighDataCamerasPresenter

        public WeighDataCamerasPresenter(ModalViewManager modal, IEventAggregator eventAgrigator)
        {
            _modalManager = modal;
            _eventAgrigator = eventAgrigator;

            CloseMeCommand = new DelegateCommand<object>(CloseMe);
        }
開發者ID:Minatron,項目名稱:Minatron,代碼行數:7,代碼來源:WeighDataCamerasPresenter.cs

示例11: MainPageViewModel

        /// <summary>
        /// Initializes the services and commands.
        /// </summary>
        /// <param name="bibleRepository">A repository of <see cref="Bible"/>.</param>
        /// <param name="navigationService">A implementation of Navigation</param>
        public MainPageViewModel(IBibleRepository bibleRepository, INavigationService navigationService)
        {
            _bibleRepository = bibleRepository;

            LoadChaptersCommand = new DelegateCommand<Book>(LoadChapters);
            ShowChapterCommand = new DelegateCommand<Chapter>(ShowChapter);
        }
開發者ID:RafaelPlantard,項目名稱:GodWord,代碼行數:12,代碼來源:MainPageViewModel.cs

示例12: RegionOnPopupWindowContentControlViewModel

        public RegionOnPopupWindowContentControlViewModel( Model model )
        {
            Model = model;

            ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
            ConfirmationRequest = new InteractionRequest<INotification>();
        }
開發者ID:JackWangCUMT,項目名稱:Plainion,代碼行數:7,代碼來源:RegionOnPopupWindowContentControlViewModel.cs

示例13: SearchResultsPageViewModel

        public SearchResultsPageViewModel(ApplicationSettings settings, INavigationService navigationService, IImageSearchService imageSearchService, IHub hub, IAccelerometer accelerometer, IStatusService statusService, IShareDataRequestedPump shareMessagePump)
        {
            _settings = settings;
            _navigationService = navigationService;
            _imageSearchService = imageSearchService;
            _hub = hub;
            _accelerometer = accelerometer;
            _statusService = statusService;

            HomeCommand = _navigationService.GoBackCommand;
            ViewDetailsCommand = new DelegateCommand(ViewDetails, () => SelectedImage != null);
            LoadMoreCommand = new AsyncDelegateCommand(LoadMore);
            ThumbnailViewCommand = new DelegateCommand(ThumbnailView);
            ListViewCommand = new DelegateCommand(ListView);
            SplitViewCommand = new DelegateCommand(SplitView);
            SettingsCommand = new DelegateCommand(Settings);

            AddImages(_settings.SelectedInstance.Images);
            shareMessagePump.DataToShare = _settings.SelectedInstance.QueryLink;
            _statusService.Title = _settings.SelectedInstance.Query;
            _accelerometer.Shaken += accelerometer_Shaken;
            _navigationService.Navigating += NavigatingFrom;

            UpdateCurrentView(CurrentView);
            _hub.Send(new UpdateTileImageCollectionMessage(_settings.SelectedInstance));
        }
開發者ID:schmidp,項目名稱:GettingStartedWithMetroApps,代碼行數:26,代碼來源:SearchResultsPageViewModel.cs

示例14: CompareFilesViewModel

 public CompareFilesViewModel(ReadOnlyObservableCollection<HexFileViewModel> files)
 {
     this.files = files;
     CloseCommand = new DelegateCommand(OnClose);
     IndexOfTheSelectedLeftFile = 0;
     IndexOfTheSelectedRightFile = 1;
 }
開發者ID:KiselevKN,項目名稱:BootMega,代碼行數:7,代碼來源:CompareFilesViewModel.cs

示例15: InitializeCommands

 private void InitializeCommands()
 {
     NewAlbumCommand = new DelegateCommand(NewAlbum);
     DeleteAlbumCommand = new DelegateCommand(DeleteSelectedAlbum);
     EditAlbumCommand = new DelegateCommand(EditSelectedAlbum);
     PowerShellConsoleCommand = new DelegateCommand(_powerShellConsoleLauncher.Launch);
 }
開發者ID:hugodahl,項目名稱:powershell-for-developers,代碼行數:7,代碼來源:AlbumListViewModel.cs


注:本文中的System.Windows.Input.DelegateCommand類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。