1

I set it like code below, but it did not worked.

ProductList.Margin = 10 //Exception
JohnMax
  • 103
  • 7

2 Answers2

0

If ProductList is a View you can change its padding and margin like this:

ProductList.Css.Padding = 10;
ProductList.Css.Margin = 20;
ctyar
  • 931
  • 2
  • 10
  • 22
0

Alternatively you can use the extension methods which provide a fluent API (as they return the object back) like the following:

ProductList.Padding(10).Margin(20);

These extension methods allow you to set specific sides too. For example:

ProductList.Padding(top: 10, right: 15)
           .Margin(vertical: 20); // <-- this sets both top and bottom
Paymon
  • 1,173
  • 1
  • 9
  • 26