StringFormat для привязываемого свойства, не отображающего дополнительный текстC#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 StringFormat для привязываемого свойства, не отображающего дополнительный текст

Сообщение Anonymous »


So I have created a custom control in .net MAUI XAML with Bindable Properties.

For one, I wish to display a % as a suffix after the text on a specific view, but the StringFormat doesn't display it.

My View element

My code

public static readonly BindableProperty PercentProperty = BindableProperty.Create(nameof(Percent), typeof(string), typeof(StatsControl), propertyChanged: (bindable, oldValue, newValue) => { var control = (StatsControl)bindable; control.PercentEntry.Text = newValue as string; }); public string Percent { get => GetValue(PercentProperty) as string; set => SetValue(PercentProperty, value); } The actual value is correctly presented and works OK. But no other text I place in the StringFormat either before or after the value is shown!


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

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

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

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

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

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

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