H
hufaunder
In XAML you can give a name to each element so you can access it in
the code behind file. This works fine for a WPF application but not a
Windows Form application. Here is what I do:
1) Create a new WinForm application project
2) Add a new WPF User Control
3) In the XAML file give the grid a name, i.e. <grid Name="grid1">
4) In the code behind file trying to add this.grid1 but it's not
picked up.
Another strange thing is that when I try to compile the project it
does not see InitializeComponent. It says "The name
InitializeComponent does not exist in the current context". I guess
the two problem are related but how do I get it to work?
Again, if in 1) I create a WPF project everything works just fine.
Thanks
the code behind file. This works fine for a WPF application but not a
Windows Form application. Here is what I do:
1) Create a new WinForm application project
2) Add a new WPF User Control
3) In the XAML file give the grid a name, i.e. <grid Name="grid1">
4) In the code behind file trying to add this.grid1 but it's not
picked up.
Another strange thing is that when I try to compile the project it
does not see InitializeComponent. It says "The name
InitializeComponent does not exist in the current context". I guess
the two problem are related but how do I get it to work?
Again, if in 1) I create a WPF project everything works just fine.
Thanks