I am new in WPF and want to create WPF application like cookbook. I already done this and app work correctly. But I make it in this way:
First screen show buttons, which open new windows to do something. As a result i have 14 different windows. It is ok, but now i want to make it in other way.
I am trying to make one window, which will be showed at start, and change content. I divided window on two grids. First is static and is placed on bottom. It contains buttons, which represents functionality of the program. Second one will be dynamic. There i want to show content of every window. So i want to change content of this panel instead of creating new windows.
I tried to make *.cs files which will create controls in code-behind, functions and data. But my idea is not succesful and i do not know how to do this.
At all, I want to create app, which will work like this: - if you click button "Add receip" then app will show controls to add name, ingredients and save it at the end. - if you clik "Show receip" previous content will be replaced by list of ingredients
and etc.
I hope you will understand me.
DataTemplateresources, with a different view model class for each state. Then just include aContentControlwhere theContentproperty is bound to the view model for the current state.