本文整理汇总了C#中INavigation.PushModalAsync方法的典型用法代码示例。如果您正苦于以下问题:C# INavigation.PushModalAsync方法的具体用法?C# INavigation.PushModalAsync怎么用?C# INavigation.PushModalAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INavigation
的用法示例。
在下文中一共展示了INavigation.PushModalAsync方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PushModalAsync
/// <summary>
/// Push a page modal async
/// </summary>
/// <returns>awaitable task.</returns>
/// <param name="navigation">Navigation.</param>
/// <param name="page">Page.</param>
/// <param name="animate">If set to <c>true</c> animate.</param>
public static async Task PushModalAsync(INavigation navigation, Page page, bool animate = true)
{
if (navigating)
return;
navigating = true;
await navigation.PushModalAsync(page, animate);
navigating = false;
}
示例2: ShowAsync
async public Task ShowAsync (INavigation navigation)
{
System.Diagnostics.Debug.WriteLine ("StateMachine.ShowAsync()");
// push on the base nav page modally, so that the whole lot can be poped off at the end
await navigation.PushModalAsync(_navigationPage);
// wait till its finished, then clean it all up
var results = await _taskCompletionSource.Task;
await navigation.PopModalAsync ();
}
示例3: OnStart
protected async override void OnStart ()
{
Navigation = MainPage.Navigation;
var isAuthenticated = await IsAuthenticated ();
if (!isAuthenticated)
{
await Navigation.PushModalAsync (new LoginPage ());
}
var service = DependencyService.Get<ILocationService> ();
service.StartService ();
}
示例4: AcoesDePanicoViewModel
public AcoesDePanicoViewModel (INavigation navigation)
{
Navigation = navigation;
PanicContactRp = new Repository<PanicContacts> ();
//Prepara list dos protetores. O protejido eh o id da tabela PanicContact
protetores = new ObservableCollection<PanicContacts> (PanicContactRp.GetAllAsync ().
Result.Where (pr => pr.Id == Settings.user_Id));
//Prepara lista dos protegidos. Mesma tabela PanicContact, filtrando agora pelo protetor
protegidos = new ObservableCollection<PanicContacts> (PanicContactRp.GetAllAsync ().
Result.Where (re => re.Email == Settings.email));
//obtem nexID para cadastro de novos protetores
int nextIdx = 0;
foreach (var pr in protetores) {
Int32.TryParse (pr.Id, out nextIdx);
if (nextIdx > nextIDProtetor)
nextIDProtetor = nextIdx;
}
completaListaProtegidos ();
protetoresListCommand = new Command (async (key) => {
try {
if (await CrossContacts.Current.RequestPermission ()) {
var protetoresContactListView = new ContactListView (new ContactsListViewModel ());
protetoresContactListView.ContactSelected += protetor_ContactSelected;
await Navigation.PushModalAsync (new NavigationPage (protetoresContactListView));
}
} catch (Exception ex) {
Debug.WriteLine ("protetoresListCommand " + ex);
throw;
}
});
}
示例5: NavigateToSample
public async Task NavigateToSample(INavigation navigation){
SampleCoordinator.RaiseSampleSelected (this);
if (_justNotifyNavigateIntent) {
return;
}
if (_customNavigation != null) {
_customNavigation (navigation);
return;
}
int popCount = 0;
int firstPageToPopIndex = 0;
for (int i = navigation.NavigationStack.Count - 1; i >= 0; i--) {
if (navigation.NavigationStack [i].GetType () == _pageType) {
firstPageToPopIndex = i + 1;
popCount = navigation.NavigationStack.Count - 1 - i;
break;
}
}
if (popCount > 0) {
for (int i = 1; i < popCount; i++) {
navigation.RemovePage(navigation.NavigationStack[firstPageToPopIndex]);
}
await navigation.PopAsync ();
return;
}
var page = CreateContentPage ();
if (_modal) {
await navigation.PushModalAsync (new NavigationPage(page));
} else {
await navigation.PushAsync (page);
}
}
示例6: Show
public async Task Show(INavigation nav)
{
await nav.PushModalAsync(this);
IsBusy = true;
}