Click here to Skip to main content
13,046,337 members (128,302 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I'm not even sure that this is possible, but I thought that it would be smart to ask if anyone has ever done it before

I'm writing an interface in WPF using MVVM where an end user will be updating data which is collected using different user controls. The goal is to save all of the updates at the same time with an update button on the main window.

Using a Mediator, I can collect all of the information from all of the controls and then retrieve it for the update, but what would simplify everything is to just take the type that provided all of the data and store updates to IT, and then retrieve it when it's time to move these updates to the database.

I can do THAT with a generic class, but then I have to store the initial class by name to the generic class. What I'd like to do is to store whatever class I decide to use to a generic list. I can envision it, but I've never constructed that sort of relationship before.

I'm I way out to lunch here or is this something someone has done?
Posted 19-Sep-12 4:22am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If I understand you right, then all you need to do is the properties of an object (in this case the ViewModel) using reflection. You can look at the following for direction:[^]
Bob Brady 19-Sep-12 16:52pm
I saw that and I've been coding it today. However I was hoping for a better way
Clifford Nelson 19-Sep-12 17:17pm
Create an infrastructure, and then you can post an article on Codeproject with the code. Then there will be something better.
Bob Brady 20-Sep-12 8:51am
In fact, I completely believe that. Genius rises to a challenge, not a question

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100