本文整理汇总了C#中System.DelegateCommand类的典型用法代码示例。如果您正苦于以下问题:C# DelegateCommand类的具体用法?C# DelegateCommand怎么用?C# DelegateCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DelegateCommand类属于System命名空间,在下文中一共展示了DelegateCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryViewModel
public QueryViewModel(ItemFilter item)
{
InnerItem = item;
QueryHelpCommand = new DelegateCommand(RaiseQueryHelpInteractionRequest);
QueryCheckCommand = new DelegateCommand(RaiseQueryCheckInteractionRequest);
}
示例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));
}
示例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;
}
示例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());
}
}
示例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();
}
});
}
示例9: MainPageViewModel
public MainPageViewModel(INavigationService navigationService, IEventAggregator eventAggregator)
{
_navigationService = navigationService;
_eventAggregator = eventAggregator;
NavigateCommand = new DelegateCommand(Navigate);
}
示例10: ReservationsViewModel
public ReservationsViewModel(IServiceFactory serviceFactory)
{
_ServiceFactory = serviceFactory;
ExecuteRentalCommand = new DelegateCommand<int>(OnExecuteRentalCommandExecute);
CancelReservationCommand = new DelegateCommand<int>(OnCancelReservationCommandExecute);
}
示例11: InitCommands
private void InitCommands()
{
StartFtpCommand = new DelegateCommand(StartFtp);
ProcessFilesCommand = new DelegateCommand(FindAll);
FindByCaseNumberCommand = new DelegateCommand(FindByCaseNumber);
ValidateCommand = new DelegateCommand(Validate);
}
示例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);
}
示例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);
}
示例14: PageStartMenuViewModel
public PageStartMenuViewModel(IRegionManager regionManager, ITaskDialogService taskDialog)
{
_regionManager = regionManager;
_taskDialog = taskDialog;
NavigateCommand = new DelegateCommand<Uri>(Navigate);
ExitCommand = new DelegateCommand<Window>(ExitGame);
}
示例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);
}