public void Init()
        {
            if (store != null)
            {
                return;
            }
            DBError error;

            store = DBDatastore.OpenDefaultStoreForAccount(DBAccountManager.SharedManager.LinkedAccount, out error);
            var sync = store.Sync(null);

            store.AddObserver(store, () => {
                LoadData();
            });
            AutoUpdating = true;
            store.BeginInvokeOnMainThread(() => {
                timer = NSTimer.CreateRepeatingScheduledTimer(1, () => {
                    if (!AutoUpdating)
                    {
                        return;
                    }
                    store.Sync(null);
                });
            });
        }
        public void Init()
        {
            if (store != null)
            {
                return;
            }
            DBError error;

            store = DBDatastore.OpenDefaultStoreForAccount(DBAccountManager.SharedManager.LinkedAccount, out error);
            store.Sync(null);
            store.AddObserver(store, () => {
                LoadData();
            });
        }
        public void Init()
        {
            if (store != null)
            {
                return;
            }
            DBError error;

            store = DBDatastore.OpenDefaultStoreForAccount(DBAccountManager.SharedManager.LinkedAccount, out error);
            var sync = store.Sync(null);

            store.AddObserver(store, () => {
                Console.Write("store observer ");

                store.Sync(null);                 // needed?

                var table   = store.GetTable(tableName);
                var results = table.Query(null, out error);

                Console.WriteLine(results.Length);

                ProccessResults(results);
            });


            // TIMER TO AUTOUPDATE
            AutoUpdating = true;
            store.BeginInvokeOnMainThread(() => {
                timer = NSTimer.CreateRepeatingScheduledTimer(2, () => {
                    if (!AutoUpdating)
                    {
                        return;
                    }
                    //Console.WriteLine("AutoUpdating"); // SPAM
                    store.Sync(null);
                });
            });
        }