else
{
// Layout not being replaced so restore margin and padding to View.
- SetValue(MarginProperty, layout.Margin);
- SetValue(PaddingProperty, layout.Padding);
+ if (NUIApplication.IsUsingXaml)
+ {
+ SetValue(MarginProperty, layout.Margin);
+ SetValue(PaddingProperty, layout.Padding);
+ }
+ else
+ {
+ SetInternalMarginProperty(this, null, layout.Margin);
+ SetInternalPaddingProperty(this, null, layout.Padding);
+ }
NotifyPropertyChanged();
}
}
{
// If View already has a margin set then store it in Layout instead.
value.Margin = margin;
- SetValue(MarginProperty, new Extents(0, 0, 0, 0));
+ using var temp = new Extents(0, 0, 0, 0);
+ if (NUIApplication.IsUsingXaml)
+ {
+ SetValue(MarginProperty, temp);
+ }
+ else
+ {
+ SetInternalMarginProperty(this, null, temp);
+ }
setMargin = true;
}
{
// If View already has a padding set then store it in Layout instead.
value.Padding = padding;
- SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
+ using var temp = new Extents(0, 0, 0, 0);
+ if (NUIApplication.IsUsingXaml)
+ {
+ SetValue(PaddingProperty, temp);
+ }
+ else
+ {
+ SetInternalPaddingProperty(this, null, temp);
+ }
setPadding = true;
}