public static ContainerBuilder CreateContainerBuilder(MainActivity activity, ShareIntentReceiver myReceiver)
        {
            var builder = new ContainerBuilder();

            builder.RegisterType <DialogService>().As <IDialogService>().SingleInstance();
            builder.RegisterType <PicturePicker>().As <IPicturePicker>().SingleInstance();
            builder.RegisterType <UriTool>().AsSelf().SingleInstance();
            builder.RegisterType <SettingsStorage>().As <ISettingsStorage>().SingleInstance();
            builder.RegisterType <ShareIntentReceiver>().As <IShareIntentReceiver>().SingleInstance();
            builder.RegisterInstance(myReceiver).AsImplementedInterfaces();

            return(builder);
        }
示例#2
0
        protected override void OnCreate(Bundle bundle)
        {
            Instance = this;

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            myReceiver = new ShareIntentReceiver();

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App(ContainerCreator.CreateContainerBuilder(this, myReceiver)));

            myReceiver.RequestPermision();
            myReceiver.OnReceive(this, Intent);
        }