WPF global font size

前端 未结 10 720
别跟我提以往
别跟我提以往 2020-12-02 08:43

I\'m creating a WPF app and I would like to know the best way to be able to change the font size for every element in the ui. Do I create a resource dictionary and set Style

10条回答
  •  盖世英雄少女心
    2020-12-02 08:48

    Using Resources in XAML is the way to go. Although there are many great answers to this question, I would like to add my two cents to the SCOPE of the Resource.

    For Global accessibility in all of the Windows and User Controls of the Project, you can have your resource in the App.xaml file

    
        
    
    

    For accessibility at a Window level, you can have your resource in your xaml file for Window

    
        
    
    

    You could even have it at a Control level, for example

    
        
    
    

提交回复
热议问题