How to set the default font for a WPF application?

后端 未结 6 729
野的像风
野的像风 2020-12-04 11:16

I want to be able to define a font family for my WPF application. Preferably using a resource dictionary as a theme referenced from App.xaml. I\'ve tried creati

6条回答
  •  失恋的感觉
    2020-12-04 11:39

    Try this simple workaround in the App.xaml (no code behind needed):

    
    
    
        
    
    

    Just bind your windows style to this. Works perfectly for me. Only some properties need to be defined in the nested tree. For example the property FontSize can be specify only in the generic section.

    I don't know why is necessary to do this trick. It's strange because Label should be derived from Control. Anyone have any idea about it?

提交回复
热议问题