What is the difference between Width and ActualWidth in WPF?

前端 未结 7 792
不知归路
不知归路 2020-11-27 05:23

I am currently working with Panels in WPF, and I noticed that as regards the Width and Height properties, there are also two other pro

7条回答
  •  面向向阳花
    2020-11-27 06:13

    I find ActualWidth most useful when I want to bind the width or height of one element to another.

    In this simple example I have two buttons arranged side by side and a comment underneath that is constrained to the width of the StackPanel containing the two buttons.

    
    
        
             

提交回复
热议问题