I'm trying to understand and learn a bit more about WPF.
In a WPF project with 30 windows, all windows must have:
- same toolbar (with the buttons: new, edit, delete, view and close)
- the same statusbar
- each window must have a tabcontrol with 2 TabItem. The contents of the first TabItem can be different according to the window. The second TabItem should always contain a datagrid with different columns according to the window.
The "logical sequence" is:
- open the window
- the user enters the parameters in the first TabItem
- the user clicks the search button
- the data are displayed in the datagarid in the second TabItem
- the user clicks on new / edit / delete / view
- show a window for editing data
The buttons new / edit / view and delete must be enabled only when a row in the gridview is selected. The "logical sequence" is valid for all windows!
In winform you can create a form with the structure to use as a template and create 30 windows that inherit from the model. With custom events in the template, you can understand if user have selected a row in the gridview, understand if the user click a button on the toolbar etc
For example, when the user click on the New button is generated the "NewItem" event that is a custom event, then in the form that inherit from the model when recive the "NewItem" event open the input form
You can do something similar in WPF?
you can create a form template in WPF and creating windows that inherit from the template?
I hope I was clear and sorry for my bad English
Thanks
So to maybe answer part of your question, I would attempt to extract your toolbar(Search, new, edit..etc..) and status bar out into the mainwindow.xaml. At that point maybe you can do something like:
Have separate views (usercontrols imo) that would be part of a content control within the main window.
ViewModel:
A question you may have: If my toolbar is in the mainwindow view model how can I talk to other view models that are used for other views?
I would look into something along the lines of MessageSenders/MessageListeners
SimpleMvvmToolKit has a nice Message system that all your viewmodels can inherit. Hope this kind of helps.