I implemented a sqlite db that saves a 'scene' name, which is the name of the class the scene takes place in.
So I have a 'MainPage', 'Scene2', 'Scene3' that are all classes with their own stack layouts.
I have checked that, upon a button click, it is returning the sceneID. I just have no idea how I would then load the class that shares the sceneID as its name to the screen so that the player would see that class's stack layout.
private void loadButton_Clicked(object sender, EventArgs e)
{
SceneState state = LoadScene();
Console.WriteLine($"SceneId: {state.SceneId}"); // these writelines were to verify the data returned
Console.WriteLine($"ButtonText: {state.ButtonText}");
Console.WriteLine($"Hp: {state.Hp}");
Console.WriteLine($"Style: {state.Style}");
}
private SceneState LoadScene()
{
lock (_context)
{
return _context.Database.Table<SceneState>().FirstOrDefault();
}
}
Thank you.