wpf - How to refer to Canvas in another XAML File? -


I have a problem finding a reference to a canvas in another XAML file in my project.

For example a canvas object in which some labels are malail out, and stored in MyLayout.xaml

I use this canvas window in the main window of the application in ASML. I like. How can this be done? There are several layouts needed to load in the window.

All the XAML is within the project and it can be compiled, can not be loaded with a file.

How can I reference the Canvas object in the MyLayout.xaml file in Window.xaml?

This can be in XAML, VB.NET code or even C #.

I searched for hours to find out. How to use an object from an XAML file in another? How is this done?

Thanks in advance I hope someone knows how to do this.

Have you thought about using UserControl or ControlTemplate?


Comments