I have a masterdetailpage and a contentpage that works as a rootpage, so to make a function run from my masterdetailpage i load it via a public method. But when I do it, it works when I type something in the log but when I try to make something real happen, for example change the text of a label or make something bigger etc. It doesn't run. Even though the System.Diagnostics.Debug inside the method runs. My code looks like this:
My masterdetailpage:
knappen.Clicked += (object sender, EventArgs e) => {
var ourStartPage = new StartPage ();
ourStartPage.InitThisPage();
}
And this is my contentpage (StartPage) with the public method that loads my particular function i want loaded:
public void InitThisPage()
{
LoadData();
}
async void LoadData()
{
label.TextColor = Color.Red; //so this does not change color
System.Diagnostics.Debug.WriteLine ("Does it reach this?"); //but it reaches this and types this out in the log.
}
So above, it reaches the thing I type in the log but the Color of the label does not change. I have tried different labels, buttons, images etc but whatever I do beside run it in the log, does not seem to run.
What can the issue be here?