WPF绑定文本时使用指定格式文本时间:2023-03-08 23:37:16 原文:WPF绑定文本时使用指定格式文本 Text="{Binding PlayletModel.characters,StringFormat=Cast : {0}}" StringFormat=Cast : {0} 上面的意思就是将int类型数据[characters]前面加文本[Cast : ] 例如: characters=50 输出: Cast : 50 注意=号后面一定要有字符串,具体格式规则请在使用中尝试