Ezekiel
❔ Populate a grid .NET MAUI
Hello guys, I want to create a grid following some logic but I can't find a solution.
I use 2 bindableProperties to know how many rows and columns I should create, like so
So this works, like it creates a grid and if i put some new elements in the grid such as
it works
But what I can't understand is that the columns and rows lists are null
and if i do something like
it won't work.
Thank you
2 replies
❔ Question for when using XAML vs C#
Hello ! So I'm programming in video Games and recently I learned .NET MAUI which is really different with XAML. And to me it is confusing when to use. As I understand the best thing to do is to use it as often as possible but in some cases I don't know how to do so.
Here is my example : I am doing some questionnaire creator and I want my user to chose as many options he wants for its question (like 5 radio buttons or 4). Then I want to instantiate all those buttons but I don't know what is the good practice. Like should I pass some parameter of number and then in my component constructor instantiate the good amount ? Or is there some XAML possibility to know how much of the same item it has to display ? Or should I just create a stackPannel and add as many component as needed in my RelayCommand ?
Thank you for your help, it is highly appreciated.
6 replies