Как привязать аннотацию модели к элементу управления на странице содержимого .net MAUI XAML?C#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 Как привязать аннотацию модели к элементу управления на странице содержимого .net MAUI XAML?

Сообщение Anonymous »


I have model like below

public class Person { [Display(Name = "Name of the Person", Prompt = "Enter your Name")] public string Name { get; set; } } .net MAUI content Page as below

The expected outcome is as shown in the image
Изображение


The purpose is to have a common model for asp.net and .net maui with annotations and efcore decorations.Syncfusion's dataform does this by default. We cannot use syncfusion.

DisplayNameAnnotation and DisplayPromptAnnotation are written for illustration only. Binding the Name to the entry control is straight forward. I wanted to bind the corresponding annotations to placeholder or text of another label. This is straight forward in asp.net application with labelfor kind of tags. But, in .net MAUI, I could not able to figure out a way to do it. Can any one point to me in right direction.


Источник: https://stackoverflow.com/questions/781 ... ntent-page
Реклама
Ответить Пред. темаСлед. тема

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

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

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

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

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

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