Created
January 9, 2016 19:01
-
-
Save wtuts/58f4fc806c892d568155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ObservableCollection<Schema.Students> Mylist; | |
protected async override void OnNavigatedTo(NavigationEventArgs e) | |
{ | |
//Set the item Source if database exists | |
bool check = await Database.DatabaseHelper.Checkdatabase(); | |
if (check) | |
{ | |
Mylist = Database.DatabaseHelper.GetAllStudents(); | |
MylistView.ItemsSource = Mylist; | |
} | |
} | |
private void Delete_Button_Click(object sender, RoutedEventArgs e) | |
{ | |
var myobject = (sender as Button).DataContext as Schema.Students; | |
//Delete the item | |
Database.DatabaseHelper.DeleteStudent(myobject.Id); | |
Mylist.Remove(myobject); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment