You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
879 B
32 lines
879 B
using Justice.Helpers;
|
|
using Justice.Models;
|
|
|
|
namespace Justice
|
|
{
|
|
public partial class App : Application
|
|
{
|
|
public App()
|
|
{
|
|
InitializeComponent();
|
|
InitializeDatabaseAsync(); // Call the async method to initialize the database
|
|
}
|
|
|
|
private async void InitializeDatabaseAsync()
|
|
{
|
|
try
|
|
{
|
|
var dbHelper = new DatabaseHelper();
|
|
await dbHelper.InitializeAsync<EmergencyContact>(); // Asynchronously create the EmergencyContact table
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine($"Database initialization failed: {ex.Message}");
|
|
}
|
|
}
|
|
|
|
protected override Window CreateWindow(IActivationState? activationState)
|
|
{
|
|
return new Window(new AppShell());
|
|
}
|
|
}
|
|
}
|
|
|