WPF XAML: How to automatically scale down children of a component in XAML?

后端 未结 2 982
时光说笑
时光说笑 2020-12-22 12:44

Here\'s my problem:

xaml file 1: a templated list control


   

        
2条回答
  •  粉色の甜心
    2020-12-22 13:04

    I believe a Viewbox will do what you want. It has a single child which is always given its desired size, and it applies a ScaleTransform to the child so that it fits inside the Viewbox. By default it will apply a uniform stretch, but you can change this by setting the Stretch property.

    Something like this:

    
        
            
                
                    
                
            
        
    
    

提交回复
热议问题