WPF: TextTrimming on a ContentPresenter

后端 未结 2 1395
长发绾君心
长发绾君心 2021-01-04 13:36

Is there a simple way to just get TextTrimming to work with a ContentPresenter?

I have implict styles for TextBlock and AccessText that have TextTrimming set to Cha

2条回答
  •  感动是毒
    2021-01-04 14:21

    Thanks to this Gist by James Nugent: "WPF style which puts character ellipsis on button contents without replacing the ContentPresenter with a TextBlock and thus losing the ability to support access keys."

    This worked for me:

    
        
    
    

提交回复
热议问题