When is x:Reference in WPF resolved and why does XAML element order affect it?

后端 未结 3 1169
小蘑菇
小蘑菇 2021-01-11 20:25

x:Reference can not be resolved after I re-arrange elements in XAML.

Here I present a working code. Just move the DataGrid element so it comes after the button eleme

3条回答
  •  太阳男子
    2021-01-11 21:12

    Excerpted from MSDN(http://msdn.microsoft.com/en-us/library/ee795380.aspx).

    x:Reference is a construct defined in XAML 2009. In WPF, you can use XAML 2009 features, but only for XAML that is not WPF markup-compiled. Markup-compiled XAML and the BAML form of XAML do not currently support the XAML 2009 language keywords and features.

提交回复
热议问题