Silverlight XAML Attribute Definition Order Matters

前端 未结 3 674
旧时难觅i
旧时难觅i 2020-12-06 05:10

I was working with the ComboBox control and couldn\'t get the SelectedItem to be set from the property on my viewmodel. Here is the control definition:



        
3条回答
  •  被撕碎了的回忆
    2020-12-06 06:08

    Yes order can matter. Consider that XAML reading involves the creation of objects and the assignment of values to the properties of these objects. Its not possible to assign property values at the same time, clearly one property is going to be assigned followed by another and then another until all properties are assigned.

    Since assigning properties in some objects results in side-effects and other code running the order of assigning those properties can impact the result. This of course is a bad thing.

提交回复
热议问题