本文整理汇总了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";
}
示例2: ComplexCustomViewViewModel
public ComplexCustomViewViewModel( Model model )
{
Model = model;
ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
ConfirmationRequest = new InteractionRequest<INotification>();
}
示例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);
}
}
示例4: CredentialModelView
public CredentialModelView()
{
Users = new ObservableCollection<CredentialUser>();
RefreshCommand = new DelegateCommand(RefreshUsers);
SaveCommand = new DelegateCommand<PasswordBox>(SaveObject);
RefreshUsers();
}
示例5: FlyoutService
public FlyoutService(IRegionManager regionManager, IApplicationCommands applicationCommands)
{
_regionManager = regionManager;
ShowFlyoutCommand = new DelegateCommand<string>(ShowFlyout, CanShowFlyout);
applicationCommands.ShowFlyoutCommand.RegisterCommand(ShowFlyoutCommand);
}
示例6: AddEditMobilePlantComponentTypeViewModel
public AddEditMobilePlantComponentTypeViewModel(MobilePlantComponentType mct)
{
mMobilePlantComponentType = mct;
OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanModifyConfig);
CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
}
示例7: RegionWithPopupWindowActionExtensionsViewModel
public RegionWithPopupWindowActionExtensionsViewModel( Model model )
{
Model = model;
ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
ConfirmationRequest = new InteractionRequest<INotification>();
}
示例8: ShellViewModel
public ShellViewModel()
{
SetVisibilityOfNavigationBack();
SystemNavigationManager.GetForCurrentView().BackRequested += SystemNavigationManager_BackRequested;
OpenPaneCommand = new DelegateCommand(OpenPaneCommandDelegate);
}
示例9: MainWindow
public MainWindow()
{
InitializeComponent();
OpenHelpPageCommand = new DelegateCommand(ExecuteOpenHelpPage);
this.DataContext = OpenHelpPageCommand;
this.InputBindings.Add(new KeyBinding(this.OpenHelpPageCommand, new KeyGesture(Key.F1)));
}
示例10: WeighDataCamerasPresenter
public WeighDataCamerasPresenter(ModalViewManager modal, IEventAggregator eventAgrigator)
{
_modalManager = modal;
_eventAgrigator = eventAgrigator;
CloseMeCommand = new DelegateCommand<object>(CloseMe);
}
示例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);
}
示例12: RegionOnPopupWindowContentControlViewModel
public RegionOnPopupWindowContentControlViewModel( Model model )
{
Model = model;
ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
ConfirmationRequest = new InteractionRequest<INotification>();
}
示例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));
}
示例14: CompareFilesViewModel
public CompareFilesViewModel(ReadOnlyObservableCollection<HexFileViewModel> files)
{
this.files = files;
CloseCommand = new DelegateCommand(OnClose);
IndexOfTheSelectedLeftFile = 0;
IndexOfTheSelectedRightFile = 1;
}
示例15: InitializeCommands
private void InitializeCommands()
{
NewAlbumCommand = new DelegateCommand(NewAlbum);
DeleteAlbumCommand = new DelegateCommand(DeleteSelectedAlbum);
EditAlbumCommand = new DelegateCommand(EditSelectedAlbum);
PowerShellConsoleCommand = new DelegateCommand(_powerShellConsoleLauncher.Launch);
}