public MainPage()
        {
            InitializeComponent();
            var x = CustomDependencyServiceExtended.Resolve <MainPage>();

            this.BindingContext = x;
        }
Ejemplo n.º 2
0
        public App()
        {
            InitializeComponent();
            RegisterServices();
            RegisterPagesVM();

            var service = CustomDependencyServiceExtended.Resolve <AService>();

            MainPage = new MainPage();
        }
Ejemplo n.º 3
0
        private List <object> instanceParameters(ParameterInfo[] ctrParams)
        {
            List <object> parametersToPass = new List <object>();

            foreach (var param in ctrParams)
            {
                var paramType = param.ParameterType;

                if (paramType is object)
                {
                    if (CustomDependencyServiceExtended.container.ContainsKey(paramType))
                    {
                        parametersToPass.Add(CustomDependencyServiceExtended.Resolve(paramType));
                    }
                }
            }
            return(parametersToPass);
        }
Ejemplo n.º 4
0
 void RegisterPagesVM()
 {
     CustomDependencyServiceExtended.RegisterFactory <MainPage, MainPageVM>();
 }
Ejemplo n.º 5
0
 void RegisterServices()
 {
     CustomDependencyServiceExtended.RegisterFactory <InstanceCreator, InstanceCreator>();
     CustomDependencyServiceExtended.RegisterFactory <AService, SomeConcreteService>();
     // CustomDependencyServiceExtended.RegisterFactory<AService, SomeConreteServiceWithConst>(() => new SomeConreteServiceWithConst(new SomeClass()));
 }