Can I achieve something like this:
<ContentPage.Content>
<RelativeLayout>
<Label x:Name="Label_Name"
Text="First Middle and Last Name"
Font="{x:Static local:ThemeConstants.RegisterNameLabel}"
VerticalOptions="Center"
HorizontalOptions="StartAndExpand"
RelativeLayout.XConstraint="{x:Static local:Style.test}"
RelativeLayout.YConstraint="{ConstraintExpression Type=Constant,Constant=10}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=1.0}"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=Constant,Constant=40}">
</Label>
</RelativeLayout>
</ContentPage.Content>
The reason for this is that I need the positions and size of views to be loaded from configuration files, and do as little as possible modifications to code.
I tried a definition for test of ConstraintExpression and string with these values
public static string test = "{ConstraintExpression Type=Constant,Constant=0}";
public static ConstraintExpression test {
get{ return new ConstraintExpression (){ Type = ConstraintType.Constant, Constant = 50 }; }
}
but no luck.