I want to set the margins of different controls using C# code-behind (I know how to do it in XAML markup).
I need it for controls like rectangle or buttons.
myControl.Margin = new Thickness(left, top, right, bottom);
or
myControl.Margin = new Thickness(allSideMarginSize);
should do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With