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" />

第二种方式不生效:

记得使用第一种

相关推荐
IT_陈寒15 小时前
Vite静态资源路径这个坑差点让我加班到凌晨
前端·人工智能·后端
掘金酱15 小时前
「TRAE Work 实战帮」征文启动!你沉淀的经验,值得被看见!
前端·人工智能·后端
橙子家15 小时前
Windows 上同时安装多个 node 版本
前端
晓说前端15 小时前
TypeScript 高级特性 —— 类型断言与泛型
前端·typescript
爱勇宝15 小时前
DeepSeek V4-Flash 更新:代码与 Agent 能力全面增强
前端·后端·deepseek
GuWenyue15 小时前
90%前端写React+TS都踩坑!从组件类型、单向数据流到本地存储完整实战
前端·react.js
风中芦苇啊16 小时前
Java EasyExcel 导入通用工具类:自定义注解映射字段 + 反射机制
java·开发语言
妙码生花16 小时前
从 PHP 到 AI + Golang,程序员自救转型手记(四十五):前端远程下拉输入组件
前端·javascript·vue.js
明月_清风16 小时前
全栈工程师必会技术栈:从入门到架构的完整成长地图 🗺️
前端·后端·全栈