Example #1
0
        public AppShell(IRickyRipository db)
        {
            InitializeComponent();

            repo = db;
            DependencyService.RegisterSingleton <IRickyRipository>(db);

            Routing.RegisterRoute(nameof(ItemDetailPage), typeof(ItemDetailPage));
            Routing.RegisterRoute(nameof(NewItemPage), typeof(NewItemPage));
            Routing.RegisterRoute(nameof(LandingPage), typeof(LandingPage));
        }
Example #2
0
        public App(IRickyRipository db)
        {
            InitializeComponent();

            DependencyService.Register <MockDataStore>();
            UnityContainer _unity = new UnityContainer();

            _unity.RegisterInstance <IRickyRipository>(db);
            _unity.RegisterInstance(typeof(IRickyRipository), db);
            DependencyService.RegisterSingleton <IRickyRipository>(db);// choose one of this 3 dude

            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(_unity));

            MainPage = new AppShell(db);
        }
 public ViewUsersViewModel(IRickyRipository Repo)
 {
     _repo = Repo;
 }