public static async Task PushPopupPageModel <T, TPopupPage>(this IPageModelCoreMethods pageModelCoreMethods, object data = null, bool animate = true) where T : FreshBasePageModel where TPopupPage : PopupPage { var pageModel = FreshIOC.Container.Resolve <T>(); var page = FreshIOC.Container.Resolve <TPopupPage>(); FreshPageModelResolver.BindingPageModel(data, page, pageModel); await PushPopupPageModel(page, animate); }
public static async Task PopAllPopups(this IPageModelCoreMethods pageModelCoreMethods) { await PopupNavigation.Instance.PopAllAsync(); }
public static async Task PopPopupPageModel(this IPageModelCoreMethods pageModelCoreMethods, bool animate = true) { await PopupNavigation.Instance.PopAsync(animate); }
public static Task PushPopupPageModel(this IPageModelCoreMethods pageModelCoreMethods, Type pageModelType, bool animate = true) { return(PushPopupPageModel(pageModelType, null, animate)); }
public static async Task PushPopupPageModel <T>(this IPageModelCoreMethods pageModelCoreMethods, object data = null, bool animate = true) where T : FreshBasePageModel { var pageModel = FreshIOC.Container.Resolve <T>(); await PushPopupPageModel(pageModel, data, animate); }
/* Overriden methods */ public override void Init(object initData) { base.Init(initData); _coreMethods = initData as IPageModelCoreMethods; }
protected override void OnBindingContextChanged() { base.OnBindingContextChanged(); var context = BindingContext as TTab; if (context == null) { return; } Context = context; NavigationService = context.Navigation; if (context.ViewBindingContext == null || BindingContext != context.ViewBindingContext) //Init Viewmodels and attach with correspoding views { switch (context.View.ToString().Substring(context.View.ToString().LastIndexOf(".", StringComparison.CurrentCulture) + 1)) { case "MapTabPage": { var mapspage = new MapPageModel(); mapspage.Init(context.Customer); context.ViewBindingContext = mapspage; BindingContext = context.ViewBindingContext; BindingContextSet(); break; } case "ContactDetailTabPage": { context.ViewBindingContext = Context.Parent; BindingContext = Context.Parent; BindingContextSet(); break; } case "OrderListTabPage": { var order = new OrderListTabPageModel(); order.Init(context.Customer); context.ViewBindingContext = order; BindingContext = order; BindingContextSet(); break; } case "QuotationsTabPage": { var quote = new QuotationsPageModel(); quote.Init(context.Customer); context.ViewBindingContext = quote; BindingContext = quote; BindingContextSet(); break; } case "ContractListTabPage": { var contract = new ContractPageModel(); contract.Init(context.Customer); context.ViewBindingContext = contract; BindingContext = contract; BindingContextSet(); break; } } } }