Ejemplo n.º 1
0
        protected void LoadApplication(Xamarin.Forms.Application application)
        {
            _application = application ?? throw new ArgumentNullException("application");

            Xamarin.Forms.Application.SetCurrentApplication(application);

            SetMainPage();
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        public void TestSamplePage()
        {
            // set up
            _ = new Xamarin.Forms.Application();
            var page = new SamplePage();

            // check
            Assert.IsNotNull(page.BindingContext, "binding context must be non-null");
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 /// <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();
 }
Ejemplo n.º 6
0
        protected void LoadApplication(Xamarin.Forms.Application application)
        {
            if (application == null)
            {
                throw new ArgumentNullException("application");
            }

            Xamarin.Forms.Application.SetCurrentApplication(application);
            _application = application;

            application.PropertyChanged += ApplicationOnPropertyChanged;
        }
Ejemplo n.º 7
0
 /// <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));
 }
Ejemplo n.º 8
0
        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>();
        }
Ejemplo n.º 9
0
        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();
        }
Ejemplo n.º 10
0
        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()}");
        }
Ejemplo n.º 12
0
        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;
        }
Ejemplo n.º 13
0
 public CustomPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window, Xamarin.Forms.Application formsApplication)
     : base(applicationDelegate, window, formsApplication)
 {
 }
Ejemplo n.º 14
0
 public Bootstrapper(Xamarin.Forms.Application app, Assembly autoRegisterAssembly) : base(autoRegisterAssembly)
 {
     App = app;
 }
 public Bootstrapper(Xamarin.Forms.Application app, Assembly autoRegisterAssembly)
     : base(autoRegisterAssembly)
 {
     App = app;
 }
Ejemplo n.º 16
0
 public MvxFormsWpfViewPresenter(ContentControl contentControl, Application formsApplication) : base(contentControl)
 {
     FormsApplication = formsApplication ?? throw new ArgumentNullException(nameof(formsApplication), "MvxFormsApplication cannot be null");
 }