Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Button click to navigate to existing page in SQLite database

$
0
0

I have an SQLite database in my app and want to navigate to a specific page by clicking the button (retrieving it from the database). I have GetPageAsync method in my database:

public Task<List<ArtistPageModel>> GetPageAsync(string keyword)
        {
            return database.Table<ArtistPageModel>().Where(i => i.Name == keyword).ToListAsync();
        }

And ButtonClicked on page where it should be done:

private async void Button_Clicked(object sender, EventArgs e)
    {
        var keyword = "Text";
        var page = await App.Database.GetPageAsync(keyword);
        await Navigation.PushAsync(page);
    }

I know this is wrong but I don't have any other solution because I'm just starting with it. Any help would be appreciated.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>