本文整理汇总了C#中INavigationService.CanGoBack方法的典型用法代码示例。如果您正苦于以下问题:C# INavigationService.CanGoBack方法的具体用法?C# INavigationService.CanGoBack怎么用?C# INavigationService.CanGoBack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INavigationService
的用法示例。
在下文中一共展示了INavigationService.CanGoBack方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HubPageViewModel
public HubPageViewModel(INavigationService navigationService, IPasswordRepository passwordRepository)
{
_navigationService = navigationService;
_passwordRepository = passwordRepository;
_passwordGroups = new ObservableCollection<PasswordGroup>();
if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
{
PasswordGroups.Add(new PasswordGroup()
{
GroupKey = "A"
});
PasswordGroups.Add(new PasswordGroup()
{
GroupKey = "C"
});
PasswordGroups.Add(new PasswordGroup()
{
GroupKey = "D"
});
}
else
{
GetData();
}
AddNewPasswordCommand = new DelegateCommand(() => AddNewPassword());
DeleteCommand = new DelegateCommand(() => Delete());
CopyToClipboardCommand = new DelegateCommand(() => CopyToClipboard());
GoBackCommand = new DelegateCommand(() => _navigationService.GoBack(), () => _navigationService.CanGoBack());
}
示例2: BaseViewModel
public BaseViewModel(INavigationService navService, IEventAggregator eventAggregator, IPurchaseManager purchaseMgr, IMessageSettingsRepository repository)
{
this._purchaseManager = purchaseMgr;
this._eventAggregator = eventAggregator;
this._navService = navService;
this._messageRepository = repository;
this.GoBackCommand = new DelegateCommand(OnGoBack, () => _navService.CanGoBack());
}
示例3: EntityDetailPageViewModel
public EntityDetailPageViewModel(IEntityRepository entityRepository, INavigationService navService, IEventAggregator eventAggregator) {
_entityRepository = entityRepository;
_navService = navService;
_eventAggregator = eventAggregator;
GoBackCommand = new DelegateCommand(
() => _navService.GoBack(),
() => _navService.CanGoBack());
NewEntityCommand = new DelegateCommand(OnNewEntity, CanNewEntity);
UpdateEntityCommand = new DelegateCommand(OnUpdateEntity, CanUpdateEntity);
DeleteEntityCommand = new DelegateCommand(OnDeleteEntity, CanDeleteEntity);
TextBoxLostFocusAction = OnTextBoxLostFocusAction;
}
示例4: StateDetailPageViewModel
public StateDetailPageViewModel(IStateRepository stateRepository, INavigationService navService, IEventAggregator eventAggregator) {
_stateRepository = stateRepository;
_navService = navService;
_eventAggregator = eventAggregator;
GoBackCommand = new DelegateCommand(
() => _navService.GoBack(),
() => _navService.CanGoBack());
NewStateCommand = new DelegateCommand(OnNewState, CanNewState);
UpdateStateCommand = new DelegateCommand(OnUpdateState, CanUpdateState);
DeleteStateCommand = new DelegateCommand(OnDeleteState, CanDeleteState);
TextBoxLostFocusAction = OnTextBoxLostFocusAction;
}
示例5: PersonDetailPageViewModel
public PersonDetailPageViewModel(IPersonRepository personRepository, INavigationService navService, IEventAggregator eventAggregator) {
_personRepository = personRepository;
_navService = navService;
_eventAggregator = eventAggregator;
GoBackCommand = new DelegateCommand(
() => _navService.GoBack(),
() => _navService.CanGoBack());
NewPersonCommand = new DelegateCommand(OnNewPerson, CanNewPerson);
UpdatePersonCommand = new DelegateCommand(OnUpdatePerson, CanUpdatePerson);
DeletePersonCommand = new DelegateCommand(OnDeletePerson, CanDeletePerson);
TextBoxLostFocusAction = OnTextBoxLostFocusAction;
}
示例6: AddEditPasswordViewModel
public AddEditPasswordViewModel(INavigationService navigationService, IPasswordRepository passwordRepository)
{
_navigationService = navigationService;
_passwordRepository = passwordRepository;
SaveCommand = new DelegateCommand(() => Save(), () => CanSave);
CopyToClipboardCommand = new DelegateCommand(() => CopyToClipboard());
GoBackCommand = new DelegateCommand(() => navigationService.GoBack(), () => navigationService.CanGoBack());
KeyPressAction = (eventArgs) =>
{
switch (eventArgs.Key)
{
case VirtualKey.Enter:
{
if(CanSave)
SaveCommand.Execute();
}
break;
default:
break;
}
};
}