Ejemplo n.º 1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            #region Reading data from local database (Sqlite)

            /*
             * using (SQLiteConnection conn=new SQLiteConnection(App.DatabaseLocation))
             * {
             *  //If table is not exists would be created
             *  //We can go to History page before insert any records
             *  conn.CreateTable<Post>();
             *
             *  var posts = conn.Table<Post>().ToList();
             *
             *  postListView.ItemsSource = posts;
             * }
             */

            #endregion Reading data from local database (Sqlite)

            await viewModel.UpdatePosts();

            // Synchronize local andcloud database
            await AzureAppServiceHelper.SyncAsync();
        }
Ejemplo n.º 2
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            viewModel.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();
        }
        private async void HistoryListView_Refreshing(object sender, EventArgs e)
        {
            await historyVM.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();

            historyListView.IsRefreshing = false;
        }
Ejemplo n.º 4
0
        private async void listview_refresh(object sender, EventArgs e)
        {
            await viewModel.Updateinfo();

            await AzureAppServiceHelper.SyncAsync();

            Listview.IsRefreshing = false;
        }
Ejemplo n.º 5
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            Hvm.ReadHistory();

            await AzureAppServiceHelper.SyncAsync();
        }
Ejemplo n.º 6
0
        async void Handle_Refreshing(object sender, System.EventArgs e)
        {
            await viewModel.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();

            postListView.EndRefresh();
        }
Ejemplo n.º 7
0
        private async void ExperienceList_Refreshing(object sender, System.EventArgs e)
        {
            await ViewModel.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();

            ExperienceList.IsRefreshing = false;
        }
Ejemplo n.º 8
0
        //TODO implement [PostListView_OnRefreshing] action inside ICommand
        private async void PostListView_OnRefreshing(object sender, EventArgs e)
        {
            await ViewModel.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();

            PostListView.IsRefreshing = false;
        }
Ejemplo n.º 9
0
        private async void LvPost_Refreshing(object sender, EventArgs e)
        {
            await Hvm.ReadHistory();

            await AzureAppServiceHelper.SyncAsync();

            lvPost.IsRefreshing = false;
        }
Ejemplo n.º 10
0
        private async void PostListView_OnRefreshing(object sender, EventArgs e)
        {
            await viewModel.UpdatePosts();

            // Synchronize local andcloud database
            await AzureAppServiceHelper.SyncAsync();

            postListView.EndRefresh();
            //postListView.IsRefreshing = false; // same as calling function above
        }
Ejemplo n.º 11
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            viewModel.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();

            //postListView.ItemsSource = posts;
        }
Ejemplo n.º 12
0
        private async void PostListView_Refreshing(object sender, EventArgs e)
        {
            viewModel.UpdatePosts();
            //Refrescamos local y luego en nube
            await AzureAppServiceHelper.SyncAsync();

            //Desaparecer el icono de refresh 2 formas
            //Forma 1 hay q convertir el Update post en task bool para que se llame cuando se hayan refrescado los posts
            // PostListView.IsRefreshing = false;
            //Forma 2
            PostListView.EndRefresh();
        }
Ejemplo n.º 13
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            /*SQLiteConnection conn = new SQLiteConnection(App.Databaselocation);
             * conn.CreateTable<info>();
             * var show = conn.Table<info>().ToList();
             * Listview.ItemsSource = show;
             * conn.Close();*/

            viewModel.Updateinfo();
            await AzureAppServiceHelper.SyncAsync();
        }
Ejemplo n.º 14
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            string list  = "Current";
            var    games = await UserGame.GetMyGameFromList(list);

            await myGameLv.FadeTo(0, 500);

            myGameLv.ItemsSource = games;
            await myGameLv.FadeTo(1, 1000);

            await AzureAppServiceHelper.SyncAsync();
        }
Ejemplo n.º 15
0
        protected async override void OnAppearing()
        {
            try
            {
                base.OnAppearing();
                await ViewModel.UpdatePosts();

                await AzureAppServiceHelper.SyncAsync();
            }
            catch (System.Exception ex)
            {
            }
        }
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            //using (SQLiteConnection conn = new SQLiteConnection(App.DataBaseLocation))
            //{
            //    conn.CreateTable<Post>();

            //    var posts = conn.Table<Post>().ToList();

            //    historyListView.ItemsSource = posts;
            //}

            await historyVM.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();
        }
Ejemplo n.º 17
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            #region SQLite Implementation
            //using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation))
            //{
            //    conn.CreateTable<Post>();
            //    var posts = conn.Table<Post>().ToList();
            //    PostListView.ItemsSource = posts;
            //}
            #endregion


            ViewModel.UpdatePosts();

            await AzureAppServiceHelper.SyncAsync();
        }
        private async void DeleteButton_OnClicked(object sender, EventArgs e)
        {
            //using (SQLiteConnection conn = new SQLiteConnection(App.DatabaseLocation))
            //{
            //    conn.CreateTable<Post>();
            //    int rows = conn.Delete(selectedPost);

            //    if (rows > 0)
            //        DisplayAlert("Success", "Experience successfully deleted", "ok");
            //    else
            //        DisplayAlert("Failure", "Deletion not successful", "bad");
            //}

            Post.Delete(selectedPost);
            await AzureAppServiceHelper.SyncAsync();

            await DisplayAlert("Success", "Deletion is successful", "ok");
        }
Ejemplo n.º 19
0
        //ANTIGUO CON CLOSE
        ////Metodo que hace override al aprecer el Tab
        ////Lo usamos para leer de la base lo que sea que deba mostrarse en este tab
        //protected override void OnAppearing()
        //{
        //    base.OnAppearing();//No borrar
        //    //coneción a la base
        //    SQLiteConnection db = new SQLiteConnection(App.DbLocation);
        //    //Creación de tabla (si ya existe la pasa por alto)
        //    db.CreateTable<Post>();
        //    //Guardar resultados toList()
        //   var post= db.Table<Post>().ToList();
        //    //Cerramos conexión
        //    db.Close();
        //}
        #endregion

        protected override async void OnAppearing()
        {
            base.OnAppearing();
            //coneción a la base SQLite
            //using (SQLiteConnection db = new SQLiteConnection(App.DbLocation))
            //{
            //    //Creación de tabla (si ya existe la pasa por alto)
            //    db.CreateTable<Post>();
            //    //Guardar resultados toList()
            //    var post = db.Table<Post>().ToList();
            //    //Pasamos la lista  aun objeto ListView
            //    PostListView.ItemsSource = post;
            //}
            viewModel.UpdatePosts();
            //Refrescamos local y luego en nube
            await AzureAppServiceHelper.SyncAsync();

            //PostListView.ItemsSource = posts;
        }
 public async void SyncOfflineDatabase()
 {
     await AzureAppServiceHelper.SyncAsync();
 }