How to use an accesskey on a WPF Button with a custom ContentTemplate?

后端 未结 1 1272
[愿得一人]
[愿得一人] 2020-12-10 16:12

Scenario:

Currently I have this XAML code:

1条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 16:59

    Instead of TextBlock use AccessText thus:

    
    

    PS. ContentPresenter should be used inside a ControlTemplate to display content according to a DataTemplate. If you use it within a DataTemplate it causes infinite recursion as the DataTemplate is invoked over and over again.

    0 讨论(0)
提交回复
热议问题