将度数符号添加到标签(Add degree symbol to label)

编程入门 行业动态 更新时间:2024-10-28 08:29:22
度数符号添加到标签(Add degree symbol to label)

我想在xaml中为此标签添加度数符号。请告诉我该怎么做?

<Label Content="{Binding CelsiusTemperature}" />

I want to add degree symbol to this label in xaml.Please tell me how to do it?

<Label Content="{Binding CelsiusTemperature}" />

最满意答案

您可以将ContentStringFormat用于Label :

获取或设置一个复合字符串,该字符串指定如果将Content属性显示为字符串,如何设置其格式。

例:

<Label Content="{Binding Path=CelsiusTemperature}" ContentStringFormat="{}{0}°" />

You can use the ContentStringFormat for Label:

Gets or sets a composite string that specifies how to format the Content property if it is displayed as a string.

Example:

<Label Content="{Binding Path=CelsiusTemperature}" ContentStringFormat="{}{0}°" />

更多推荐

xaml,<Label,Content,Binding,CelsiusTemperature,电脑培训,计算机培训,IT培训"/>

本文发布于:2023-04-28 08:07:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1331388.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:度数   符号   标签   Add   symbol

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!