Пример #1
0
		async protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			Xamarin.Forms.Forms.Init (this, bundle);

			SplashPage splashPage = new SplashPage("@drawable/splash");

			FormsApp formsApp = new FormsApp();

			MXFormsContainer.Initialize(formsApp, formsApp.NavigationPage, (t)=>{
				Xamarin.Forms.Device.BeginInvokeOnMainThread(()=>{
					//SetPage(formsApp.NavigationPage);
				});
			});

			MXFormsContainer.AddView<Home>(typeof(HomePage), ViewPerspective.Default);
			MXFormsContainer.AddView<About>(typeof(AboutPage), ViewPerspective.Default);


			await MXFormsContainer.Navigate("Home");


			SetPage(formsApp.NavigationPage);

		}
Пример #2
0
        async protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Xamarin.Forms.Forms.Init(this, bundle);

            SplashPage splashPage = new SplashPage("@drawable/splash");

            FormsApp formsApp = new FormsApp();

            MXFormsContainer.Initialize(formsApp, formsApp.NavigationPage, (t) => {
                Xamarin.Forms.Device.BeginInvokeOnMainThread(() => {
                    //SetPage(formsApp.NavigationPage);
                });
            });

            MXFormsContainer.AddView <Home>(typeof(HomePage), ViewPerspective.Default);
            MXFormsContainer.AddView <About>(typeof(AboutPage), ViewPerspective.Default);


            await MXFormsContainer.Navigate("Home");


            SetPage(formsApp.NavigationPage);
        }
Пример #3
0
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and make window visible
        // NOTE: You have 17 seconds to return from this method or iOS will terminate application
        public override bool FinishedLaunching(
            UIApplication app,
            NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            //Distribute.DontCheckForUpdatesInDebug();

            // Get Intun Parameters
            //Online.DownloadIntuneParameters ();
            //Parameters.PrepareFromIntune();

            // Core Foundation Keys:
            // https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
            var appVersion = NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"];
            var appBuild   = NSBundle.MainBundle.InfoDictionary["CFBundleVersion"];

            IBluetoothLowEnergyAdapter bluetoothLowEnergyAdapter = BluetoothLowEnergyAdapter.ObtainDefaultAdapter();
            IUserDialogs userDialogs = UserDialogs.Instance;
            string       appversion  = appVersion.Description + " ( " + appBuild.Description + " )";

            appSave = new FormsApp(bluetoothLowEnergyAdapter, userDialogs, appversion);

            // Check if FTP settings is in securestorage
            GenericUtilsClass.CheckFTPDownload();

            //TEST.Test ();

            base.LoadApplication(appSave);

            return(base.FinishedLaunching(app, options));
        }
Пример #4
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Forms.Init ();

            window = new UIWindow (UIScreen.MainScreen.Bounds);

            FormsApp formsApp = new FormsApp();

            var vc = formsApp.NavigationPage.CreateViewController ();
            window.RootViewController = vc;
            window.MakeKeyAndVisible ();

            string splashImage = "Default";

            if (UIScreen.MainScreen.Bounds.Height == 568)
                splashImage = String.Format("{0}-568h", splashImage);

            var splashPage = new SplashPage(splashImage);
            vc.PresentViewController(splashPage.CreateViewController(), false, null);

            MXFormsContainer.Initialize(formsApp, formsApp.NavigationPage, (t)=>{
                this.InvokeOnMainThread(()=>{
                    vc.DismissViewController(true, null);
                });
            });

            MXFormsContainer.AddView<Home>(typeof(HomePage), ViewPerspective.Default);
            MXFormsContainer.AddView<About>(typeof(AboutPage), ViewPerspective.Default);

            MXFormsContainer.Navigate("Home");
            return true;
        }
Пример #5
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			UINavigationBar.Appearance.TintColor = Color.Yellow.ToUIColor ();
			UINavigationBar.Appearance.BarTintColor = Color.Green.ToUIColor ();

			//override navigation bar title with text attributes
			UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes () {
				TextColor = Color.Pink.ToUIColor ()
			});

			Xamarin.Calabash.Start ();
			Forms.Init ();
			FormsMaps.Init ();
			window.RootViewController = FormsApp.GetFormsApp ().CreateViewController ();
		
			MessagingCenter.Subscribe<RootPagesGallery, Type> (this, Messages.ChangeRoot, (sender, pagetype) => {
				window = new UIWindow (UIScreen.MainScreen.Bounds);
				window.RootViewController = ((Page) Activator.CreateInstance(pagetype)).CreateViewController();
				window.MakeKeyAndVisible ();
			});

			MessagingCenter.Subscribe<HomeButton> (this, Messages.GoHome, (sender) => {
				window = new UIWindow (UIScreen.MainScreen.Bounds);
				window.RootViewController = FormsApp.GetFormsApp ().CreateViewController ();
				window.MakeKeyAndVisible ();
			});

			// make the window visible
			window.MakeKeyAndVisible ();

			return true;
		}
Пример #6
0
        protected override IMvxIosViewPresenter CreatePresenter()
        {
            Forms.Init();
            FormsMaps.Init();

            var xamarinFormsApp = new FormsApp();

            return(new MvxFormsTouchPagePresenter(Window, xamarinFormsApp));
        }
Пример #7
0
        private async Task InitializeViewModels()
        {
            var sessionInfo = await FormsApp.GetSessionTokenAndMerchantGuid();

            if (!string.IsNullOrWhiteSpace(sessionInfo.Email))
            {
                DependencyService.Get <IIntercom>().RegisterLoggedInUser(sessionInfo.Email);
                await _navigationService.Navigate <MenuViewModel>();

                await _navigationService.Navigate <TabbedHomeViewModel>();
            }
        }
Пример #8
0
        private async void RedirectIfNecessary()
        {
            var sessionInfo = await FormsApp.GetSessionTokenAndMerchantGuid();

            if (sessionInfo == null || string.IsNullOrEmpty(sessionInfo.SessionToken) || sessionInfo.MerchantGuid == null || sessionInfo.MerchantGuid == Guid.Empty)
            {
                await _navigationService.Navigate <LoginViewModel>();
            }
            else
            {
                var verifyResponse = await _sessionAuthService.Get(sessionInfo.SessionToken);

                if (verifyResponse.Data == null || !verifyResponse.Data.Any(m => m.MerchantGuid == sessionInfo.MerchantGuid))
                {
                    await _navigationService.Navigate <LoginViewModel>();
                }
            }
        }
Пример #9
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            Forms.Init(this, bundle);
            var mvxFormsApp = new FormsApp();

            LoadApplication(mvxFormsApp);

            var presenter = Mvx.Resolve <IMvxViewPresenter>() as MvxFormsDroidPagePresenter;

            presenter.MvxFormsApp = mvxFormsApp;

            Mvx.Resolve <IMvxAppStart>().Start();
        }
Пример #10
0
        public MainPage()
        {
            InitializeComponent();

            Forms.Init();
            FormsMaps.Init();

            Content = CoreGallery.GetMainPage().ConvertPageToUIElement(this);

            MessagingCenter.Subscribe <RootPagesGallery, Type>(this, Messages.ChangeRoot, (sender, pagetype) =>
            {
                var page     = ((Page)Activator.CreateInstance(pagetype));
                app.MainPage = page;
            });

            MessagingCenter.Subscribe <HomeButton>(this, Messages.GoHome, (sender) => {
                var page     = FormsApp.GetFormsApp();
                app.MainPage = page;
            });
        }
Пример #11
0
        private async Task SearchCustomers()
        {
            if (!string.IsNullOrEmpty(_searchTerm))
            {
                Loading = true;
                ShowNoCustomerWarning = false;
                var sessionInfo = await FormsApp.GetSessionTokenAndMerchantGuid();

                var customerResponse = await _customerService.Get(sessionInfo.MerchantGuid, sessionInfo.SessionToken, _searchTerm);

                if (customerResponse.IsSuccessful && customerResponse.Data.Customers != null)
                {
                    Customers = customerResponse.Data.Customers.Select(c => Mapper.Map <Customer.Customer>(c)).ToList();
                    if (Customers.Count == 0)
                    {
                        ShowNoCustomerWarning = true;
                    }
                }
                Loading = false;
            }
        }
Пример #12
0
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and make window visible
        // NOTE: You have 17 seconds to return from this method or iOS will terminate application
        public override bool FinishedLaunching(
            UIApplication app,
            NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            //Distribute.DontCheckForUpdatesInDebug();

            // Get Intun Parameters
            //var Mode = GenericUtilsClass.ChekInstallMode();
            //if (Mode.Equals("None"))
            //{
            //    MAMService.LoginUserMAM();
            //    Thread.Sleep(2000);
            //}

            //Online.DownloadIntuneParameters ();
            //Parameters.PrepareFromIntune();

            // Core Foundation Keys:
            // https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
            var appVersion = NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"];
            var appBuild   = NSBundle.MainBundle.InfoDictionary["CFBundleVersion"];

            IBluetoothLowEnergyAdapter bluetoothLowEnergyAdapter = BluetoothLowEnergyAdapter.ObtainDefaultAdapter();
            IUserDialogs userDialogs = UserDialogs.Instance;
            string       appversion  = appVersion.Description + " ( " + appBuild.Description + " )";


            appSave = new FormsApp(bluetoothLowEnergyAdapter, userDialogs, appversion);



            //string user = IntuneMAMEnrollmentManager.Instance.EnrolledAccount;
            //TEST.Test ();

            base.LoadApplication(appSave);

            return(base.FinishedLaunching(app, options));
        }
Пример #13
0
        public override async void Start()
        {
            base.Start();
            Loading = true;
            var sessionInfo = await FormsApp.GetSessionTokenAndMerchantGuid();

            var response = await _merchantStateService.Get(sessionInfo.MerchantGuid, sessionInfo.SessionToken);

            if (response.IsSuccessful)
            {
                var employees       = response.Data.Employees.Select(e => Mapper.Map <Data.Employee>(e));
                var services        = response.Data.Services.Select(s => Mapper.Map <Data.Service>(s));
                var masterClasses   = response.Data.Events.Select(e => Mapper.Map <Data.MasterClass>(e));
                var masterSchedules = response.Data.Schedules.Select(s => Mapper.Map <Data.MasterSchedule>(s));
                var locations       = response.Data.Locations.Select(l => Mapper.Map <Data.Location>(l));
                FormsApp.MerchantFieldRules = response.Data.FieldRules;
                await FormsApp.Database.Employees.RemoveAll();

                await FormsApp.Database.Employees.CreateManyAsync(employees);

                await FormsApp.Database.Services.RemoveAll();

                await FormsApp.Database.Services.CreateManyAsync(services);

                await FormsApp.Database.MasterClasses.RemoveAll();

                await FormsApp.Database.MasterClasses.CreateManyAsync(masterClasses);

                await FormsApp.Database.MasterSchedules.RemoveAll();

                await FormsApp.Database.MasterSchedules.CreateManyAsync(masterSchedules);

                await FormsApp.Database.Locations.RemoveAll();

                await FormsApp.Database.Locations.CreateManyAsync(locations);
            }

            Loading = false;
        }
Пример #14
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Forms.Init();

            window = new UIWindow(UIScreen.MainScreen.Bounds);

            FormsApp formsApp = new FormsApp();

            var vc = formsApp.NavigationPage.CreateViewController();

            window.RootViewController = vc;
            window.MakeKeyAndVisible();

            string splashImage = "Default";

            if (UIScreen.MainScreen.Bounds.Height == 568)
            {
                splashImage = String.Format("{0}-568h", splashImage);
            }

            var splashPage = new SplashPage(splashImage);

            vc.PresentViewController(splashPage.CreateViewController(), false, null);

            MXFormsContainer.Initialize(formsApp, formsApp.NavigationPage, (t) => {
                this.InvokeOnMainThread(() => {
                    vc.DismissViewController(true, null);
                });
            });


            MXFormsContainer.AddView <Home>(typeof(HomePage), ViewPerspective.Default);
            MXFormsContainer.AddView <About>(typeof(AboutPage), ViewPerspective.Default);

            MXFormsContainer.Navigate("Home");
            return(true);
        }
Пример #15
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            System.Maui.Maui.Init(this, bundle);
            FormsMaps.Init(this, bundle);

            SetPage(FormsApp.GetFormsApp());

            MessagingCenter.Subscribe <RootPagesGallery, Type> (this, Messages.ChangeRoot, (sender, pageType) => {
                var page = ((Page)Activator.CreateInstance(pageType));
                SetPage(page);
            });

            MessagingCenter.Subscribe <RootPagesGallery, Type> (this, Messages.ChangeRoot, (sender, pageType) => {
                var page = ((Page)Activator.CreateInstance(pageType));
                SetPage(page);
            });

            MessagingCenter.Subscribe <HomeButton> (this, Messages.GoHome, (sender) => {
                var screen = FormsApp.GetFormsApp();
                SetPage(screen);
            });
        }
Пример #16
0
 public static void Main(string[] args)
 {
     UI.Publish("/", new App().Element);
     UI.Publish("/forms", FormsApp.GetFormsApp());
 }
        async partial void UIButton2390_TouchUpInside(UIButton sender)
        {
            var settingsViewControler = FormsApp.GetPage <SettingsPage>().CreateViewController();

            await this.PresentViewControllerAsync(settingsViewControler, true);
        }
Пример #18
0
 public object GetForms() => new ElementResult(FormsApp.GetFormsApp());
Пример #19
0
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and make window visible
        // NOTE: You have 17 seconds to return from this method or iOS will terminate application
        public override bool FinishedLaunching(
            UIApplication app,
            NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            //Distribute.DontCheckForUpdatesInDebug();

            /*
             * IntuneMAMPolicyManager value = IntuneMAMPolicyManager.Instance;
             * NSDictionary dictionary =  value.DiagnosticInformation;
             *
             * NSString[] keys = new NSString[]{new NSString("AppConfig")};
             *
             * NSDictionary key= dictionary.GetDictionaryOfValuesFromKeys(keys);
             *
             * var ftp_username = new NSObject();
             * var ftp_pathremotefile = new NSObject();
             * var cert_file = new NSObject();
             * var ftp_password = new NSObject();
             * var ftp_host = new NSObject();
             *
             * for (int i = 0, keyCount = (int)key.Count; i < keyCount; i++)
             * {
             *  NSObject fields_values = key.ElementAt(i).Value;
             *
             *  ftp_username = fields_values.ValueForKey(new NSString("ftp_username"));
             *  ftp_pathremotefile = fields_values.ValueForKey(new NSString("ftp_pathremotefile"));
             *  cert_file = fields_values.ValueForKey(new NSString("cert_file"));
             *  ftp_password = fields_values.ValueForKey(new NSString("ftp_password"));
             *  ftp_host = fields_values.ValueForKey(new NSString("ftp_host"));
             *
             *  Console.WriteLine("ftp_username: {0}, ftp_pathremotefile: {1}, cert_file: {2}, ftp_password: {3}, ftp_host: {4}",
             *                    ftp_username, ftp_pathremotefile, cert_file, ftp_password, ftp_host );
             * }
             *
             * List <string> listaDatos = new List<string>();
             *
             * try{
             *  listaDatos.Add("ftp_username: "******"ftp_pathremotefile: " + ftp_pathremotefile);
             * }catch (Exception c1){}
             *
             * try{
             *  listaDatos.Add("cert_file: " + cert_file);
             * }catch (Exception c1) { }
             *
             * try{
             *  listaDatos.Add("ftp_password: "******"ftp_host: " + ftp_host);
             * }catch (Exception c1) { }
             */

            List <string> listaDatos = new List <string>();

            var AppVersion = NSBundle.MainBundle.InfoDictionary["CFBundleVersion"];

            IBluetoothLowEnergyAdapter bluetoothLowEnergyAdapter = BluetoothLowEnergyAdapter.ObtainDefaultAdapter();
            IUserDialogs userDialogs = UserDialogs.Instance;
            NSString     appversion  = (Foundation.NSString)AppVersion.Description;

            /*
             * appSave = new FormsApp (
             *  bluetoothLowEnergyAdapter,
             *  userDialogs,
             *  listaDatos,
             *  appversion);
             */


            appSave = new FormsApp(
                bluetoothLowEnergyAdapter, listaDatos, userDialogs, appversion);



            //appSave = new FormsApp(bluetoothLowEnergyAdapter);

            base.LoadApplication(appSave);

            return(base.FinishedLaunching(app, options));
        }
Пример #20
0
 public MvxFormsAndroidViewPresenter(FormsApp mvxFormsApp)
     : base(mvxFormsApp)
 {
 }
Пример #21
0
        protected override void OnMAMCreate(Bundle bundle)
        {
            //TabLayoutResource = Resource.Layout.Tabbar;
            // ToolbarResource = Resource.Layout.Toolbar;

            base.OnMAMCreate(bundle);

            UserDialogs.Init(this);
            global::Xamarin.Forms.Forms.Init(this, bundle);
            Xamarin.Essentials.Platform.Init(this, bundle);

            try
            {
                // If you want to enable/disable the Bluetooth adapter from code, you must call this.
                BluetoothLowEnergyAdapter.Init(this);
            }
            catch (Exception e)
            {
                Utils.Print(e.StackTrace);
            }

            // Obtain the bluetooth adapter so we can pass it into our (shared-code) Xamarin Forms app. There are
            // additional Obtain() methods on BluetoothLowEnergyAdapter if you have more specific needs (e.g. if you
            // need to support devices with multiple Bluetooth adapters)
            var bluetooth = BluetoothLowEnergyAdapter.ObtainDefaultAdapter(ApplicationContext);

            if (Xamarin.Forms.Device.Idiom == TargetIdiom.Phone)
            {
                RequestedOrientation = ScreenOrientation.Portrait;
            }
            else
            {
                RequestedOrientation = ScreenOrientation.Landscape;
            }

            // CrossCurrentActivity.Current.Init ( this, bundle );

            var data = Intent.Data;

            // check if this intent is started via custom scheme link
            if (data != null)
            {
                if (data.Scheme == "aclara-mtu-programmer")
                {
                    //accessCodeTextbox.Text = data.Host;
                }
            }

            // Set our view from the "main" layout resource
            //SetContentView(Resource.Layout.SplashScreen);

            Context     context    = Android.App.Application.Context;
            PackageInfo info       = context.PackageManager.GetPackageInfo(context.PackageName, 0);
            string      appversion = info.VersionName + " ( " + info.VersionCode + " )";

            FormsApp app = new FormsApp(bluetooth, UserDialogs.Instance, appversion);

            LoadApplication(app);

            app.HandleUrl(new System.Uri(data.ToString()), bluetooth);
        }
Пример #22
0
 public FormsWrapperPage()
 {
     this.InitializeComponent();
     LoadApplication(_formsApp = new FormsApp());
 }