Привязки в .NET MAUI очень противоречивы и содержат ошибки.C#

Место общения программистов C#
Гость
Привязки в .NET MAUI очень противоречивы и содержат ошибки.

Сообщение Гость »


So in my app, I have a

Код: Выделить всё

ContentView
as follows:
In the page's C#, I have a

Код: Выделить всё

BindableProperty
as follows:

Код: Выделить всё

public static readonly BindableProperty RecipeProperty = BindableProperty.Create(nameof(Recipe), typeof(Recipe), typeof(MealRecipeView)); public Recipe Recipe {     get { return (Recipe)GetValue(RecipeProperty); }     set     {         SetValue(RecipeProperty, value);         OnPropertyChanged(nameof(Recipe));     } } 
Note that this is a simplified version of my view. I have just removed the namespaces and styles.

My issue is quite odd. The above view works perfectly fine under the following scenario:
...but as soon as I wrap

Код: Выделить всё

MealRecipeView
with a VerticalStackLayout, the binding doesn't work anymore:
And no, this is not a sizing issue. I have checked using the Live Visual Tree, in the latter, no views are created under my

Код: Выделить всё

ContentView
.

My question is that is this just some MAUI bug, and should I really be using it for serious projects? If not, can you suggest me some other similar frameworks that work on C# backend? Or maybe this is an issue of my own making?

I'm quite frustrated and have been stuck on this problem for 2 days. Any help would be appreciated. Thanks!


Источник: https://stackoverflow.com/questions/781 ... -and-buggy

Вернуться в «C#»