改变stringformat颜色 [英] change stringformat color

查看:711
本文介绍了改变stringformat颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有这个文本块:

< TextBlock Text =" {Binding name,StringFormat =' &NBSP; nom:{0}'}"字号= QUOT; 28" &NBSP; X:名称= QUOT; texblock1" TextWrapping = QUOT;包覆与QUOT; Foreground =" Black" />

<TextBlock Text="{Binding name,StringFormat='   nom : {0}'}" FontSize="28"  x:Name="texblock1" TextWrapping="Wrap" Foreground="Black"/>

我需要为'nom'和'name'设置不同的颜色,例如一个是黑色而另一个是黄色......我在考虑多绑定,但我没有找到解决方案:(

i need to make a different color for 'nom' and 'name' for example one is black and the other yellow..i was thinking about multibinding but i didn't found a solution :(

有什么想法吗?

谢谢 

推荐答案

我会制作两个不同的元素。看起来你正在使用"nom"作为标签;为什么不使用它?那么您可以使Label和TextBlock的样式不同。

I would make two different elements. It seems like you're using "nom" as a Label; why not use that? Then you can have the Label and TextBlock styled differently.


这篇关于改变stringformat颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆