I am trying to create a table in C# by using the grid system.
When the grid is generated I assign it to my property GridLayoutand use Bindingto set it in my XAML. However the page remains blank. I know for a fact it does reach this method, because I used a different way of displaying the view within this method prior to implementing the grid. I have no idea as to why the generated grid is not Bindingin my XAML. All I see is a blank page.

My ViewModel:

My XAML:

My question:
Why can’t I bind the dynamically created GRID to my XAML? What is it that I am doing wrong?

I looked up a couple of questions on SO (StackOverflow), unfortunately without much success. The closest I have come was this article/tutorial: https://www.c-sharpcorner.com/article/xamarin-forms-dynamic-gridview/#:~:text=Dynamic%20GridView%20is%20a%20ViewGroup,attributes%20are%20rather%20self%2Dexplanatory.

You might need to implement INotifyPropertyChanged in your GroundMoistureViewModel. Since the GridLayout is null initially, the binding is never made aware of the update.
Edit: an example

I typically make an ObservableClass which my viewmodels will inherit one way or another. This implements the INotifyPropertyChanged interface. Then I add the method OnPropertyChanged and I call it on properties that I bind to in my xaml.

Here’s an example of a property that my xaml binds to.
I tried, but when using INotifyPropertyChanged , it doesn’t even reach this page.

Don’t call an async void from a void.
Make your timer callback async and then await initCycle from that. Make that an async Task. Make GetDatabaseData an async Task as well. Make CreateXamlTable sync.

source