Setting Panel.Background on a Border object?

前端 未结 1 675
名媛妹妹
名媛妹妹 2021-01-22 14:36

I am not understanding how this Button Template Example from Microsoft is working... In its storyboards for its various states, it is setting Panel.Background for a target type

相关标签:
1条回答
  • 2021-01-22 15:41

    That is because dependency properties can be reused, the Border just adds the property of the Panel via AddOwner. The property field is initialized like this:

    public static readonly DependencyProperty BackgroundProperty =
             Panel.BackgroundProperty.AddOwner(typeof(Border), ...
    

    So the Panel.Background property is the same as the Border.Background property.

    0 讨论(0)
提交回复
热议问题