public SettingsObjectAttribute(Type view, Type viewModel)
{
if (!CheckInheretenceHierarchy(view, typeof(UserControl)))
{
throw new Exception("View type must inherit from UserControl.");
}
if (view.GetConstructor(Type.EmptyTypes) == null)
{
throw new Exception("View type must contain a parameterless contructor.");
}
if (!CheckInheretenceHierarchy(viewModel, typeof(SettingsViewModelBase)))
{
throw new Exception("ViewModel type must inherit from SettingsViewModelBase.");
}
if (viewModel.GetConstructor(Type.EmptyTypes) == null)
{
throw new Exception("ViewModel type must contain a parameterless contructor.");
}
View = view;
ViewModel = viewModel;
}