将度数符号添加到标签(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培训"/>
发布评论