mardi 28 juillet 2015

How can I set the collection object in database table using SQlite?

I am developing a WPF application in which I have a class 'Movie' which contain some properties and another class MovieCollection(which is the collection of movie). Right now I have bind this collection with my DataGrid in xaml to show Movie properties. I am taking user input by opening new window at run time and populate the observable collection with that to show it in my DataGrid, but now I want to store data in database first and fetch that data from database to show it in DataGrid. MovieCollection class is something like this

ObservableCollection<Movie> _movieObservableCollection=new ObservableCollection<Movie> ();
public ObservableCollection<Movie> MovieObservableCollection
{
    get { return _movieObservableCollection; }
    set 
    { 
        _movieObservableCollection = value;
        this.NotifyPropertyChanged("MovieObservableCollection");
    }
}

Here I want to set this collection such that the properties of model class shown as the columns attributes of the table.

How can I do this?

How can I proceed with this?

Any link?

Aucun commentaire:

Enregistrer un commentaire