Wpf reusable window model/template

Viewed 4128

I'm trying to understand and learn a bit more about WPF.

In a WPF project with 30 windows, all windows must have:

  1. same toolbar (with the buttons: new, edit, delete, view and close)
  2. the same statusbar
  3. 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:

  1. open the window
  2. the user enters the parameters in the first TabItem
  3. the user clicks the search button
  4. the data are displayed in the datagarid in the second TabItem
  5. the user clicks on new / edit / delete / view
  6. 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

This is the form with the first tab selected

This is the fom with the second tab selected

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

2 Answers
Related