Click here to Skip to main content
15,119,322 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am working with a dashboard Project which contains
1. Treeview(on the Right Side)
2. Charts and Grids(on the Left Side)
3. Menubar with 5 - 6 menuitems inside

What I have tried:

I have done each everything in different Windows(XAML)(almost 10 - 15). Now in the Main Window, when I try to merge - Treeview, charts and grids, the design look  so gibberish
Another problem whenever any changes happens, Treeview, Grid and Charts should be refreshed properly, which is not happening. Now the project is in total Confusion. 
I need to design as well as develop too. 
1. Should I have one Window and all other should be in User control.
2. Is MVVM will be a good format to it?
3. Also while designing in WPF, all the controls should be inside a Grid or StackPanel?Finding sometimes difficult to resize the controls
4. 
Please pour me ideas as I am a newbie, who started career after a break. I also have more questions to ask. 
Posted
Updated 3-Jun-19 10:21am

1) As it appears you want one window with a lot of controls in it, then yes - it sounds reasonable to have user controls and one window. :)
2) Yes. And make sure everything is databound, not set by code. Make sure INotifyPropertyChanged is implemented (personally I do it all the way from the model, some just in the view model - but then you need to make sure the view models communicate with each other as needed).
3) Look here: WPF Layouts - A Visual Quick Start[^] and remember you can nest controls (so put a stack panel inside a dock panel). And of course you can have user controls as well with their own internal layout, making it easier to modularize the program. The right approach is whichever is most logical to you... you are the one having to maintain it in the future.
4) The first thing you need to realize is WPF is all about databinding. If you are not databinding your view to a view model you are most likely doing it wrong, and you need to ask how to do it. Don't continue writing code that update values in the controls directly.
   
Comments
Priya Karthish 3-Jun-19 15:09pm
   
Thank you. One more question, Is it better to keep the Menu bar in the Main Window or seperate User control and then add to the Main Window.
lmoelleb 3-Jun-19 15:15pm
   
Main window. And be prepared to move things around, you will learn as you go.
Priya Karthish 3-Jun-19 15:18pm
   
Thanks a lot
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900