WPF Button Content 的StringFormat

XML 复制代码
<telerik:RadButton
    Grid.Column="0"
    Height="40"
    Command="{Binding DataContext.FlowControlCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
    CommandParameter="{Binding}"
    FontSize="14"
    FontWeight="SemiBold">
    <TextBlock
        Height="40"
        FontSize="14"
        FontWeight="SemiBold"
        Text="{Binding FlowDescription, StringFormat={}执行{0}}" />
</telerik:RadButton>

<telerik:RadButton
    Grid.Column="1"
    Height="30"
    Background="#6C757D"
    Command="{Binding DataContext.LookFlowCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
    CommandParameter="{Binding}"
    Content="{Binding TreeViewActionModel, StringFormat=查看:{0}}"
    FontSize="12" />

第二种方式不生效:

记得使用第一种

相关推荐
Su米苏3 分钟前
Spring AI 中MCP 与普通 @Tool的区别
java·人工智能·spring
明月_清风8 分钟前
Deno 终局来了:从挑战 Node 到被 Cloudflare 收编
前端·后端·node.js
码云数智-园园15 分钟前
unique_ptr 还是 shared_ptr?C++ 智能指针选型与内存泄漏实战分析
java·开发语言
老板一杯拿铁17 分钟前
Java 异常体系详解:从字节码原理到最佳实践
java
蜗牛互联网32 分钟前
Java 17 HttpClient调用文件转写API的超时与失败回退
java·人工智能·后端
禾小西1 小时前
07丨Redis 哨兵机制:主库故障后,如何恢复服务?
java·开发语言·redis
我不是阵雨1 小时前
JDK 21虚拟线程Pinning陷阱:一文拔钉解困
java·开发语言
Csvn1 小时前
框架性能优化
前端
小卡车5551 小时前
java反射、自定义注解的应用(自定义分页)
java
BLUcoding2 小时前
接口服务公网超时排查记录:SecureRandom 阻塞问题分析与解决
java·linux·springboot·aes·securerandom