Beispiel #1
0
        public TestView()
        {
            InitializeComponent();

            databaseService     = CustomDependencyService.Get <IDatabaseService>();
            randomService       = CustomDependencyService.Get <IRandomService>();
            fileEmbeddedService = CustomDependencyService.Get <IFileEmbeddedService>();
        }
Beispiel #2
0
        public RawSQLitePlatformService()
        {
            var path = CustomDependencyService.Get <IPathService>().GetDatabasePath("RawSqlite");

            if (!File.Exists(path))
            {
                SqliteConnection.CreateFile(path);
            }

            base.ApplySerialized();
            Connection = new SqliteConnection($"Data Source={path};Version=3;PRAGMA journal_mode=WAL;PRAGMA cache_size=1;PRAGMA synchronous=1;PRAGMA locking_mode=EXCLUSIVE");
        }
Beispiel #3
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            CustomDependencyService.Register <PathService>();
            CustomDependencyService.Register <IRawSQLitePlatformService, RawSQLitePlatformService>();

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
Beispiel #4
0
 public RawJsonService()
 {
     pathService = CustomDependencyService.Get <IPathService>();
 }
Beispiel #5
0
 private void ChangeDatabaseServiceType(Type targetType)
 {
     CustomDependencyService.Register(targetType);
     App.ChangePresented();
 }
Beispiel #6
0
 public MasterDetailPageMasterViewModel()
 {
     MenuItems = new ObservableCollection <MasterDetailPageMenuItem>(CustomDependencyService.Get <MenuService>().GetMenuItems());
 }
Beispiel #7
0
        public OrmSqliteService()
        {
            connection = new SQLite.SQLiteAsyncConnection(CustomDependencyService.Get <IPathService>().GetDatabasePath("sqlite.db"));

            CreateTables();
        }
Beispiel #8
0
 public RawSQLiteService()
 {
     platformService = CustomDependencyService.Get <IRawSQLitePlatformService>();
 }
Beispiel #9
0
 public LiteDBService()
 {
     database = new LiteDatabase(CustomDependencyService.Get <IPathService>().GetDatabasePath("LiteDB"));
     MapModels();
 }
Beispiel #10
0
 public RealmService()
 {
     database = Realms.Realm.GetInstance(CustomDependencyService.Get <IPathService>().GetDatabasePath("Realm"));
 }