Skip to content

Commit

Permalink
Fix a padding issue on BaseMaterialFieldControl
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBonilla committed Nov 23, 2023
1 parent a185e29 commit 9bbd409
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public TextAlignment HorizontalTextAlignment
set { SetValue(HorizontalTextAlignmentProperty, value); }
}

public static readonly new BindableProperty PaddingProperty =
BindableProperty.Create(nameof(Padding), typeof(Thickness), typeof(BaseMaterialFieldControl), defaultValue: new Thickness(16, 8));

public new Thickness Padding
{
get { return (Thickness)GetValue(PaddingProperty); }
set { SetValue(PaddingProperty, value); }
}

#endregion Properties

#region Text
Expand Down Expand Up @@ -704,7 +713,7 @@ public void UpdateLayout(string propertyName)
this._lblLabel.Margin = LabelMargin;
break;
case nameof(Padding):
_frmContainer.Padding = this.Padding;
_frmContainer.Padding = Padding;
break;
case nameof(CornerRadius):
this._frmContainer.CornerRadius = CornerRadius;
Expand Down Expand Up @@ -823,7 +832,7 @@ protected virtual void Initialize()
{
CornerRadius = new CornerRadius(10, 10, 0, 0),
HasShadow = false,
Padding = new Thickness(16, 8),
Padding = Padding,
Type = MaterialCardType.Custom
};

Expand All @@ -833,14 +842,14 @@ protected virtual void Initialize()
RowSpacing = 0,
RowDefinitions = new RowDefinitionCollection()
{
new RowDefinition(){ Height = 16 },
new RowDefinition(){ Height = 24 }
new RowDefinition { Height = 16 },
new RowDefinition { Height = 24 }
},
ColumnDefinitions = new ColumnDefinitionCollection()
{
new ColumnDefinition(){Width = GridLength.Auto },
new ColumnDefinition(){Width = GridLength.Star },
new ColumnDefinition(){Width = GridLength.Auto }
new ColumnDefinition { Width = GridLength.Auto },
new ColumnDefinition { Width = GridLength.Star },
new ColumnDefinition { Width = GridLength.Auto }
}
};

Expand Down

0 comments on commit 9bbd409

Please sign in to comment.