Specifically I want all PasswordBox’s using a Style to have the same static KeyDown event handler – would it be possible to somehow set this in the Style they are using rather than setting it on each PasswordBox? (which I am having to do in code behind at the moment as they all point to the same static handler)..
Specifically I want all PasswordBox’s using a Style to have the same static KeyDown
Share
EventSetteris your friend. As for the handler – just put it into code-behind (you can create a code-behind for a resource dictionary too – just crate a CS file with the same name as the dictionary and add the class attribute to the resource dictionary XAML).Small example: