mirror of https://github.com/AMT-Cheif/Stylet.git
Fix Stylet.Samples.OverridingViewManager
This commit is contained in:
parent
eeeb761e0d
commit
ff2ca4deb2
|
@ -38,12 +38,12 @@ namespace Stylet.Samples.OverridingViewManager
|
||||||
this.viewModelToViewMapping = mappings.ToDictionary(x => x.ViewModel, x => x.View);
|
this.viewModelToViewMapping = mappings.ToDictionary(x => x.ViewModel, x => x.View);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override UIElement CreateViewForModel(object model)
|
protected override Type LocateViewForModel(Type modelType)
|
||||||
{
|
{
|
||||||
Type viewType;
|
Type viewType;
|
||||||
if (!this.viewModelToViewMapping.TryGetValue(model.GetType(), out viewType))
|
if (!this.viewModelToViewMapping.TryGetValue(modelType, out viewType))
|
||||||
throw new Exception(String.Format("Could not find View for ViewModel {0}", model.GetType().Name));
|
throw new Exception(String.Format("Could not find View for ViewModel {0}", modelType.Name));
|
||||||
return (UIElement)IoC.GetInstance(viewType, null);
|
return viewType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue