Beispiel #1
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;
        }