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
public App() | |
{ | |
this.InitializeComponent(); | |
this.Suspending += this.OnSuspending; | |
HardwareButtons.BackPressed += HardwareButtons_BackPressed; | |
} | |
private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e) | |
{ | |
var rootFrame = Window.Current.Content as Frame; |
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; |
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
<Grid> | |
<TextBlock Margin="20,10,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
FontSize="36" | |
Text="All Students" /> | |
<ListView x:Name="MylistView" | |
Margin="20,80,20,20" | |
HorizontalAlignment="Stretch" | |
VerticalAlignment="Stretch"> |
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 async void Insert_Button_Click(object sender, RoutedEventArgs e) | |
{ | |
//Creating a new data object | |
var obj = new Database.Schema.Students | |
{ | |
Name = NameBox.Text, | |
Marks = Convert.ToInt32(MarksBox.Text) | |
}; |
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
<Grid> | |
<TextBlock Margin="20,10,0,0" | |
HorizontalAlignment="Left" | |
VerticalAlignment="Top" | |
FontFamily="Segoe UI" | |
FontSize="32" | |
Text="Add a new Student" | |
TextWrapping="Wrap" /> | |
<TextBlock Margin="20,80,0,0" | |
HorizontalAlignment="Left" |
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
<Grid> | |
<Button Margin="10,30,10,0" | |
HorizontalAlignment="Stretch" | |
VerticalAlignment="Top" | |
Click="Create_Database_Click" | |
Content="Create the Database" /> | |
<Button Margin="10,90,10,0" | |
HorizontalAlignment="Stretch" | |
VerticalAlignment="Top" | |
Click="Delete_Database_Click" |
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 void Display_All_Recods_Click(object sender, RoutedEventArgs e) | |
{ | |
Frame.Navigate(typeof(Display)); | |
} |
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 void Add_New_Record_Click(object sender, RoutedEventArgs e) | |
{ | |
Frame.Navigate(typeof (AddRecord)); | |
} |
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 async void Delete_Database_Click(object sender, RoutedEventArgs e) | |
{ | |
var status = await Database.DatabaseHelper.DeleteDatabase(); | |
var content = status ? "Database Deleted" : "Doesn't Exists"; | |
var mm = new MessageDialog(content); | |
await mm.ShowAsync(); | |
} |
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 async void Create_Database_Click(object sender, RoutedEventArgs e) | |
{ | |
var status = await Database.DatabaseHelper.Createdatabase(); | |
var content = status ? "Database Created" : "Already Exists"; | |
var mm = new MessageDialog(content); | |
await mm.ShowAsync(); | |
} |