I would like to change the text (Content property) of a button when the SHIFT key is pressed. In that cases the button shall execute a different command. That is a common UI behaviour e. g. in Photoshop.
Any idea how to do this.
Many thanks in advance
2
Answers
Here my solution (event is handled at the Window) - many thanks for your input - if there is a better solution kindly comment...
Add the
KeyDown
orPreviewKeyDown
event to your Button element.And the C# Code:
Have a look on this Article for more information:
https://learn.microsoft.com/de-de/dotnet/api/system.windows.input.keyboard.keydown?view=netcore-3.1