I have this binding in my XAML
<Grid RowDefinitions="{Binding Deff}">
<BoxView Grid.RowSpan="2" BackgroundColor="White">
</BoxView>
<Grid>
<Path Data="M0,0H375V129.651s-9.025,2.382-55.426-5.3-70.141-41.09-130.3-41.176-83.544,33.5-130.893,41.176S0,129.651,0,129.651Z"
Aspect="Fill" Fill="#00a758"/>
</Grid>
</Grid>
and in my class c# :
public partial class Test: ContentPage
{
public GridLength Deff { get; set; }
public Test()
{
InitializeComponent();
if (Device.Idiom == TargetIdiom.Tablet)
{
Deff = 80;
}
else
{
Deff = 20;
}
BindingContext = this;
}
it dosent work , even i tried this code also
public partial class Test: ContentPage
{
public RowDefinitionCollection Deff { get; set; }
public Test()
{
InitializeComponent();
if (Device.Idiom == TargetIdiom.Tablet)
{
Deff = (RowDefinitionCollection)new RowDefinitionCollectionTypeConverter().ConvertFromInvariantString("80,*");
}
else
{
Deff = (RowDefinitionCollection)new RowDefinitionCollectionTypeConverter().ConvertFromInvariantString("20,*");
}
BindingContext = this;
}
and same problem dosent work.
Any solution please.