diff options
Diffstat (limited to 'JVDesktop/ViewLocator.cs')
| -rw-r--r-- | JVDesktop/ViewLocator.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/JVDesktop/ViewLocator.cs b/JVDesktop/ViewLocator.cs index f289d15..6015998 100644 --- a/JVDesktop/ViewLocator.cs +++ b/JVDesktop/ViewLocator.cs @@ -7,12 +7,11 @@ namespace JVDesktop; public class ViewLocator : IDataTemplate { - public Control? Build(object? param) { if (param is null) return null; - + var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal); var type = Type.GetType(name); @@ -20,7 +19,7 @@ public class ViewLocator : IDataTemplate { return (Control)Activator.CreateInstance(type)!; } - + return new TextBlock { Text = "Not Found: " + name }; } |
