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
I suppose it is because your resources(Window.Resources) will be created first, before referenced instance exists. I would try to solve this through DataContext (ViewModel).