New to WPF, so please bear with me...
Suppose I have 2 tables in SQL
Thing
OtherThing
Both have the exact same fields:
ID (int)
Name (string)
Description (string)
IsActive (bit/bool)
DateModified (DateTime)
So, I want to create one Model (not two) and do something like this:
BaseModel<T>()
{
public int ID {get;set;}
...
}
etc. (of course, using the INotifyPropertyChanged, just trying to keep the code simple).
I want to be able to create a BaseView and BaseViewModel that would work with whatever model conforms to the Thing/OtherThing.
I am really at a loss as to what to do here to make this generic, so I don't have to have a ThingView/ThingViewModel and a OtherThingView/OtherThingViewModel...
It seems that this should be simple, but I cannot seem to figure it out. Does anyone have a code example where they could interchange various items from a dropdown list using ONE view, ONE ViewModel, and ONE datamodel?