Rajat Saxena
Rajat Saxena

Reputation: 3935

Windows Phone how to bind XAML listbox to sqlite database

I am building a chat application for Windows Phone 8.1(Yes!another one).Is there anyway I can bind my database table to the listbox i.e if I add a row to the database,one item should be automatically added to the listbox? In my previous app I did something like whenever user tries to save an object,the app saves the object to the database,then manually creates a different object(suitable for listbox) based on the object just saved to the db and adds it to ObservableCollection bound to the listbox. Is there any better approach than this?

Upvotes: 0

Views: 367

Answers (1)

Ken Tucker
Ken Tucker

Reputation: 4156

There is no way to bind to a table in a Sqlite Database you will have to add a record to a ObservableCollection just before you add a new record to the database the same way as you did before.

Upvotes: 1

Related Questions