From 3f8e818b58127a2fad66ed67032344f553632c38 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 7 Jan 2026 19:30:57 +0800 Subject: Add Avalonia Project --- JVDesktop/ViewLocator.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'JVDesktop/ViewLocator.cs') 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 }; } -- cgit