Возникли проблемы с привязкой данных MAUI для работы с карточкой компонентов материала.C#

Место общения программистов C#
Ответить
Гость
 Возникли проблемы с привязкой данных MAUI для работы с карточкой компонентов материала.

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


I'm having trouble getting MAUI data bindings to play nicely with the Material Components Card (in code mdc:Card).

If I remove the mdc:Card the bindings work perfectly fine, which makes me believe the issue lies specifically with that component and needing to update the binding context in some way.

The TapGestureRecogniser is not working, neither are the actual data bindings further down.

Visual Studio at least seems to recognise the bindings because it autocompletes when setting the binding context paths.

Example Class:

public class FooBar { public string Name { get; set; } public string Description { get; set; } } XAML Code: I've tried to remove as much of the extra styling fluff as possible hence the ellipses

I attempted set the x:DataType of the mdc:Card to x:DataType="models:FooBar" as well as the BindingContext (with something similar to the tap gesture), but that didn't work.

Googling the issue returns some similar but unrelated problems - the x:DataType of the ContentPage is set to the viewmodel, not the collectionview model.


Источник: https://stackoverflow.com/questions/781 ... nents-card
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

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