How to animate Margin property in WPF

前端 未结 5 741
攒了一身酷
攒了一身酷 2020-12-13 09:23

I want to move animate an rectangle object to move it in x-axis. I am new to WPF animation, started out with the following:



        
5条回答
  •  庸人自扰
    2020-12-13 10:02

    As an alternative answer @McGarnagle you can use animation for HorizontalAlignment and VerticalAlignment properties.

    Example:

    
    
        
            
                Center
            
        
    
    

提交回复
热议问题