I understand there are a few post asking about adding buttons dynamically but I could not find out how to organize them on the stackpanel
.
I have no issue addi
Try this:
If you need to have a button at the beginning, when you initialize your view do the following:
Button b = new Button(); ;
b.Content = "Button";
b.Click += Button_Click;
ButtonsUniformGrid.Children.Add(b);
Then, everytime you click on it will put a new button in the grid. Let me know if you have any other questions about this :)
As commented Uwp
doesn't include UniformGrid
if you don't specify it in your xaml. If you want to use it, just include this:
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
and your UniformGrid
will be like this: