void WireUpLongRunningTask()
        {
            MessagingCenter.Subscribe <StartLongRunningTaskMessage>(this, "StartLongRunningTaskMessage", async message => {
                _longRunningTaskService = new LongRunningTaskService();
                await _longRunningTaskService.Start();
            });

            MessagingCenter.Subscribe <StopLongRunningTaskMessage>(this, "StopLongRunningTaskMessage", message => {
                _longRunningTaskService.Stop();
            });
        }
Example #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            MessagingCenter.Subscribe <StartLongRunningTaskMessage>(this, "StartLongRunningTaskMessage", message =>
            {
                var intent      = new Intent(this, typeof(LongRunningTaskService));
                var parcelable  = new UploadLongRunningTaskParcelable();
                parcelable.Task = new UploadLongRunningTask();
                intent.PutExtra("task", parcelable);
                //StartService(intent);
                LongRunningTaskService.EnqueueWork(this, intent);
            });

            MessagingCenter.Subscribe <StopLongRunningTaskMessage>(this, "StopLongRunningTaskMessage", message =>
            {
                var intent = new Intent(this, typeof(LongRunningTaskService));
                StopService(intent);
            });

            var fr = new CultureInfo("fr-FR");

            Thread.CurrentThread.CurrentCulture = fr;

            // --typeof(LetterSpacingLabelRenderer)
            var t = typeof(PopolLib.Droid.Renderers.LetterSpacingLabelRenderer);

            PopolLib.Droid.Renderers.FastListView.FastListViewRenderer.Init();
            PopolLib.Droid.Platforms.Platform.Init(this, savedInstanceState);

            this.Window.SetBackgroundDrawable(new ColorDrawable()
            {
                Color = Android.Graphics.Color.White
            });

            App.ScreenSize = new Xamarin.Forms.Size(Resources.DisplayMetrics.WidthPixels / Resources.DisplayMetrics.Density,
                                                    Resources.DisplayMetrics.HeightPixels / Resources.DisplayMetrics.Density);

            LoadApplication(new App());
        }