Setting Foreground Color of Entire Window

后端 未结 4 900
小蘑菇
小蘑菇 2020-12-08 10:42

I\'d like to set the foreground (text) color to all of my elements You\'d think this would be easy, but it\'s not...


   <         


        
4条回答
  •  半阙折子戏
    2020-12-08 11:09

    It would certainly be annoying if you have hundreds of individual elements to configure, but I'm assuming you won't have hundreds of different types of elements.

    That being the case, one thing you can do is create Styles for your types, and set the foreground colors there.

    Ideally, this might be in a ResourceDictionary and each Style would reference a common foreground Color, like

    
    
        
    
        
    
        
    
    
    

    Then you apply this resource dictionary to the Window(s) that need it, like:

    
        
            
                
                    
                
            
        
    
        
            
        
    
    

提交回复
热议问题