0
Ich versuche, die widthproperty einer Spaltendefinition zu binden, aber kann nicht scheinen, um die Bindung zu erhalten. Kann mir jemand sagen, wie man an eine Xamarin Grid-Spaltendefinition an eine Eigenschaft bindet?Xamarin Forms Bindung an ColumnDefinition Width Eigenschaft
Bindungseigenschaft in benutzerdefinierten Klasse:
public static readonly BindableProperty PointsColumnsProperty = BindableProperty.Create(nameof(PointsBarColumns), typeof(ColumnDefinitionCollection), typeof(RewardsPanel), new ColumnDefinitionCollection());
Das ist mein Eigentum:
public GridLength PointsFill {
get => (GridLength)GetValue(PointsFillProperty);
set => SetValue(PointsFillProperty, value);
}
Dies ist, wie ich die Bindung setze:
_pointsBar.ColumnDefinitions[0].SetBinding(ColumnDefinition.WidthProperty, nameof(PointsFill));