Mobile/CafeLib.Mobile/Services/MobileService.cs
/// <summary>
/// Asynchronously adds page to the top of the modal stack.
/// </summary>
/// <typeparam name="T">view model type</typeparam>
/// <param name="viewModel">view model</param>
/// <param name="animate">optional animation</param>
/// <returns></returns>
Asynchronously adds page to the top of the modal stack.
Asynchronously adds page to the top of the modal stack .
public async Task PushModalAsync<T>(T viewModel, bool animate = false) where T : BaseViewModel
        {
            var vm = viewModel ?? Resolve<T>();
            var page = vm.ResolvePage();
            page.SetViewModel(vm);
            if (page.GetAttribute<ShowModalInHostAttribute>() != null)
            {
                await GetCurrentNavigation().PushModalAsync(new ModalNavigationPage(page), animate);
            }
            else
            {
                await GetCurrentNavigation().PushModalAsync(page.HasToolbarItems() ? new ModalNavigationPage(page) : page, animate);
            }
        }
public async Task PushModalAsync < T > ( T viewModel , bool animate = false ) where T : BaseViewModel { var vm = viewModel ?? Resolve < T > ( ) ; var page = vm . ResolvePage ( ) ; page . SetViewModel ( vm ) ; if ( page . GetAttribute < ShowModalInHostAttribute > ( ) != null ) { await GetCurrentNavigation ( ) . PushModalAsync ( new ModalNavigationPage ( page ) , animate ) ; } else { await GetCurrentNavigation ( ) . PushModalAsync ( page . HasToolbarItems ( ) ? new ModalNavigationPage ( page ) : page , animate ) ; } }
Asynchronously adds page to the top of the modal stack.
Asynchronously adds page to the top of the modal stack .
None
viewModel
T
None
animate
bool
None
typeparam
view model type
view model type