protected void LoadApplication(Xamarin.Forms.Application application) { _application = application ?? throw new ArgumentNullException("application"); Xamarin.Forms.Application.SetCurrentApplication(application); SetMainPage(); }
private void AddOptions(Xamarin.Forms.Application current) { current.Properties["notificationPeriod"] = notificationPeriod; //save objects as serialized instance current.Properties["notificationType"] = Newtonsoft.Json.JsonConvert.SerializeObject(notificationType); current.Properties["notificationStartTime"] = Newtonsoft.Json.JsonConvert.SerializeObject(notificationStartTime); current.Properties["notificationEndTime"] = Newtonsoft.Json.JsonConvert.SerializeObject(notificationEndTime); }
public void TestSamplePage() { // set up _ = new Xamarin.Forms.Application(); var page = new SamplePage(); // check Assert.IsNotNull(page.BindingContext, "binding context must be non-null"); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); appInstance = new App(); LoadApplication(appInstance); AppsFlyerLib.Instance.StartTracking(Application, ConfigSettings.AppsFlyerDevKey); AppsflyerUID = AppsFlyerLib.Instance.GetAppsFlyerUID(Application.Context); Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this; }
/// <summary> /// Hardware-Backbutton /// </summary> public override void OnBackPressed() { // this is not necessary, but in Android user has both Nav bar back button and physical back button its safe to cover the both events Xamarin.Forms.Application myapplication = Xamarin.Forms.Application.Current; if (myapplication.MainPage.SendBackButtonPressed()) { return; } base.OnBackPressed(); }
protected void LoadApplication(Xamarin.Forms.Application application) { if (application == null) { throw new ArgumentNullException("application"); } Xamarin.Forms.Application.SetCurrentApplication(application); _application = application; application.PropertyChanged += ApplicationOnPropertyChanged; }
/// <summary> /// reagiert auf den Software-Backbutton (fkt. NUR mit SetSupportActionBar() in OnCreate()) /// </summary> /// <param name="item"></param> /// <returns></returns> public override bool OnOptionsItemSelected(IMenuItem item) { // check if the current item id is equals to the back button id if (item.ItemId == Android.Resource.Id.Home) { Xamarin.Forms.Application myapplication = Xamarin.Forms.Application.Current; if (myapplication.MainPage.SendBackButtonPressed()) { return(false); } } return(base.OnOptionsItemSelected(item)); }
public static void Init(Xamarin.Forms.Application app, ViewModelNavigation nav) { nav.Add <LoginViewModel, LoginView>(); nav.Add <ChangePasswordViewModel, ChangePasswordView>(); nav.Add <SendResetPasswordLinkViewModel, SendResetPasswordView>(); nav.Add <ResetPasswordViewModel, ResetPasswordView>(); nav.Add <InviteUserViewModel, InviteUserView>(); nav.Add <RegisterUserViewModel, RegisterView>(); nav.Add <VerifyUserViewModel, VerifyUserView>(); nav.Add <OrgEditorViewModel, OrgEditorView>(); nav.Add <UserOrgsViewModel, UserOrgsView>(); nav.Add <AcceptInviteViewModel, AcceptInviteView>(); }
public void LoadApplication(Xamarin.Forms.Application application) { Current = this; Application.Top.Add(Current); if (application == null) { throw new ArgumentNullException(nameof(application)); } Xamarin.Forms.Application.SetCurrentApplication(application); _application = application; application.PropertyChanged += ApplicationOnPropertyChanged; UpdateMainPage(); }
public async void SaveOptions() { JSONSerializer jSON = new JSONSerializer(); Xamarin.Forms.Application current = Xamarin.Forms.Application.Current; if (current.Properties.Count == 0) { current.Properties.Add("notificationPeriod", notificationPeriod); current.Properties.Add("notificationType", Newtonsoft.Json.JsonConvert.SerializeObject(notificationType)); current.Properties.Add("notificationStartTime", Newtonsoft.Json.JsonConvert.SerializeObject(notificationStartTime)); current.Properties.Add("notificationEndTime", Newtonsoft.Json.JsonConvert.SerializeObject(notificationEndTime)); } else { AddOptions(current); } await current.SavePropertiesAsync(); }
public void LoadApplication(Xamarin.Forms.Application application) { Application.UseSystemConsole = false; Application.Init(); Current = Application.Top; if (application == null) { throw new ArgumentNullException(nameof(application)); } Xamarin.Forms.Application.SetCurrentApplication(application); _application = application; application.PropertyChanged += ApplicationOnPropertyChanged; SetupStatusBar(); Current.KeyDown += KeyDownHandler; Current.Add(statusBar); UpdateMainPage(); Debug.WriteLine($"Driver: {Application.Driver.GetType()}"); }
new protected void LoadApplication(Xamarin.Forms.Application application) { //Xamarin.Forms.Application.Current = application; typeof(Xamarin.Forms.Application).GetProperty("Current", BindingFlags.Static | BindingFlags.Public) .SetValue(Xamarin.Forms.Application.Current, application); application.PropertyChanged += new PropertyChangedEventHandler(this.ApplicationOnPropertyChanged); typeof(FormsApplicationPage).GetField("application", BindingFlags.NonPublic | BindingFlags.Instance) .SetValue(this, application); //application.SendStart(); application.GetType().GetMethod("SendStart", BindingFlags.NonPublic | BindingFlags.Instance) .Invoke(application, null); this.SetMainPage(); var mp = (Xamarin.Forms.NavigationPage)application.MainPage; mp.BackgroundColor = Xamarin.Forms.Color.FromHex("EFEFEF"); mp.PropertyChanged += MainPage_PropertyChanged; this.Title = mp.Title; }
public CustomPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window, Xamarin.Forms.Application formsApplication) : base(applicationDelegate, window, formsApplication) { }
public Bootstrapper(Xamarin.Forms.Application app, Assembly autoRegisterAssembly) : base(autoRegisterAssembly) { App = app; }
public MvxFormsWpfViewPresenter(ContentControl contentControl, Application formsApplication) : base(contentControl) { FormsApplication = formsApplication ?? throw new ArgumentNullException(nameof(formsApplication), "MvxFormsApplication cannot be null"); }