Applying a style to all derived classes in WPF

前端 未结 2 1122
既然无缘
既然无缘 2020-12-11 02:52

I want to apply a style to all classes derived from Control. Is this possible with WPF? The following example does not work. I want the Label, TextBox and Button to have a M

2条回答
  •  北海茫月
    2020-12-11 03:44

    Here's one solution: