Rely on CS-Script includes for modules view model matching

This commit is contained in:
SpoinkyNL committed 2018-03-04 22:27:57 +01:00
1 parent 34b9c81df7
commit 9ad3e04a69
21 files changed
+301 -81

No files matched your search

+2 -1
View File
@@ -22,8 +22,9 @@ namespace Artemis.UI.Stylet
private UIElement CreateViewForPlugin(object model)
{
var viewName = model.GetType().Name.Replace("Model", "");
var pluginInfo = ((IModuleViewModel) model).PluginInfo;
var viewPath = pluginInfo.Folder + pluginInfo.ViewModel.Replace("ViewModel", "View").Replace(".cs", ".xaml");
var viewPath = $"{pluginInfo.Folder}{viewName}.xaml";
// There doesn't have to be a view so make sure one exists
if (!File.Exists(viewPath))
return null;