I have a ViewModel like this:
public class Column {
public string Name;
public string Type;
public object Content;
}
The content can be int, string ... Depending on the Type, I call a specific EditorTemplate: Column_int, Column_string ... no problem.
However, I have a GeoPoint type that I also want to use, with the corresponding EditorTemplate Column_GeoPoint column. The problem is that in my controller when the ViewModel is dispatched when I do this:
GeoPoint geoPoint = ((GeoPoint) mViewModel.Content);
I get an exception for an exception.
Any ideas on how to include an object in another in the ViewModel?
source
share