Silverlight - Setting DataContext in XAML rather than in constructor?

后端 未结 7 524
心在旅途
心在旅途 2020-12-01 05:42

How can I set the DataContext on my Grid in XAML, instead of in the constructor?

Here is how I do it in the constructor (LayoutRoot is the XAML Grid defined in the X

相关标签:
7条回答
  • 2020-12-01 06:12

    This is not possible (It is possible in WPF with {Binding RelativeSource={RelativeSource Self}}, but Silverlight is more limited.

    You have to do it through code.

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