From c7428fab1c38d29bcc50ee263678504e34d01318 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 1 Feb 2021 22:13:46 -0500 Subject: Moved project files --- ViewLocator.cs | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 ViewLocator.cs (limited to 'ViewLocator.cs') diff --git a/ViewLocator.cs b/ViewLocator.cs deleted file mode 100644 index 0a6eb01..0000000 --- a/ViewLocator.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using Avalonia.Controls; -using Avalonia.Controls.Templates; -using Erable.ViewModels; - -namespace Erable -{ - public class ViewLocator : IDataTemplate - { - public bool SupportsRecycling => false; - - public IControl Build(object data) - { - var name = data.GetType().FullName!.Replace("ViewModel", "View"); - var type = Type.GetType(name); - - if (type != null) - { - return (Control)Activator.CreateInstance(type)!; - } - else - { - return new TextBlock { Text = "Not Found: " + name }; - } - } - - public bool Match(object data) - { - return data is ViewModelBase; - } - } -} \ No newline at end of file -- cgit v1.2.3