3

I have observed a strange behavior, I have a XAML Combobox (SilverLight4) declaration with bound SelectedItem and ItemsSource and it appears that the order of SelectedItem and ItemsSource does matter... If SelectedItem is 2nd the control doesn't init properly (nothing is selected), if it was code I can understand why it matter because you can't select item which is not in combobox items collection, but this is XAML...

Do I understand it right that XAML attributes order influences generated code line order? Or it's just something wrong with my code?

Alex Burtsev
  • 12,418
  • 8
  • 60
  • 87

1 Answers1

5

That's right - check the answers here: Silverlight XAML Attribute Definition Order Matters, it's due to the XAML being used to create the objects.

Community
  • 1
  • 1
Jackson Pope
  • 14,520
  • 6
  • 56
  • 80
  • 2
    +1 for the irony of getting more upvotes to linking to an existing answered question than the original answerers actually got for their answer. – AnthonyWJones Feb 08 '11 at 13:30
  • @AnthoyWJones: Hardly seems fair does it? – Jackson Pope Feb 08 '11 at 14:17
  • This issue is still present in the current release of Win8 and/or VS11 (currently at Consumer Preview and Beta) for a C# and XAML Metro style application when using a GridView. http://www.kelvinhammered.com/?p=159 – Michael May 22 '12 at 19:29