I am developing a WPF Application for a Shop.
So i have a MainWindow and all the rest will be Child.
Which is the best thing to Use as Child Window.
- Window
- UserControl
Window will be normal, it will be top on the MainWindow and if its UserControl it will be in a Canvas of a MainWindow.
So can anyone suggest me which is best to use out of this two.
I would recommend using UserControls for your child windows. This allows you to set up all of the “parent” controls on your main window and the children won’t override them.
As a further suggestion, I would recommend looking into Caliburn Micro. That is a great framework for dealing with WPF windows and user controls.
To add a child UserControl to the parent window, I usually just add a ContentControl to my main form like so:
Just assign your child to that control and you will be fine.