mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Rely on CS-Script includes for modules view model matching
This commit is contained in:
1 parent
34b9c81df7
commit
9ad3e04a69
21 files changed
+301
-81
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user