I am just starting a new WPF project using MVVM as a general guideline. The application will have a ribbon; when you switch between tabs, there will be different buttons that spawn dockable windows in the content pane below the ribbon. This part is done. Now, each of those windows contains a different user control. These user controls all can interact with data used in the other user controls. There is going to be somewhere between 20 - 30 different user controls. My question: Is it more efficient for me to create one single static instance of these user controls or to generate and destroy each user control as I need it? Using the static controls method, the user controls would always be in memory but there would be considerably less run time code (the interaction code along with the loading of the data; this program is very data intensive). Generating and destroying the controls as needed would no longer keep the controls in memory constantly, but the run time code would be more complex and could possibly cost more in terms of efficiency. Is one method a really bad idea because of X reason that I may have over looked? Are there certain cases where one method is highly efficient over the other? Any guidance on this issue would be greatly appreciated!
goody11 -2 Junior Poster
JOSheaIV 119 C# Addict
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.