In .NET MAUI 9.0 Ich erstelle eine App basierend auf einem benutzerdefinierten Layout, das die Grid-Klasse erweitert, die mehrere BindingProperties verwendet, die ich keine Probleme habe, mit: < /p>
< /p>
Code: Select all
namespace krizanke_ux.Resources.LayoutResources
{
public partial class ParametricGrid : Grid
{
public static readonly BindableProperty GridWidthProperty =
BindableProperty.Create(nameof(GridWidth), typeof(double), typeof(ParametricGrid), 10.0,
propertyChanged: (b, o, n) => ((ParametricGrid)b).RebuildGrid(),
validateValue: (b, value) => (double)value >= 0.0);
BindableProperty.CreateAttached("GridHorizontalAlignment",
typeof(LayoutAlignment), typeof(ParametricGrid), LayoutAlignment.Start);
public static LayoutAlignment GetGridHorizontalAlignment(BindableObject view) =>
(LayoutAlignment)view.GetValue(GridHorizontalAlignmentProperty);
public static void SetGridHorizontalAlignment(BindableObject view, LayoutAlignment value) =>
view.SetValue(GridHorizontalAlignmentProperty, value);
< /code>
< /code>
Ich kann die Lösung nirgendwo finden. Ich habe versucht, sowohl Layoutoptionen als auch Layoutalignment zu verwenden, indem ich Gridhorizontalalignmen = "{X: Statische Layoutalignment>
Mobile version