- shit: Cleanup this mess
This commit is contained in:
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Reflection;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Templates;
|
||||
using Nebula.Launcher.ViewHelper;
|
||||
using Nebula.Launcher.ViewModels;
|
||||
|
||||
namespace Nebula.Launcher;
|
||||
@@ -13,15 +12,12 @@ public class ViewLocator : IDataTemplate
|
||||
{
|
||||
if (param is null)
|
||||
return null;
|
||||
|
||||
|
||||
var type = param.GetType().GetCustomAttribute<ViewModelRegisterAttribute>()?.Type;
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
return (Control)Activator.CreateInstance(type)!;
|
||||
}
|
||||
if (type != null) return (Control)Activator.CreateInstance(type)!;
|
||||
|
||||
return new TextBlock { Text = "Not Found: " + param.GetType()};
|
||||
return new TextBlock { Text = "Not Found: " + param.GetType() };
|
||||
}
|
||||
|
||||
public bool Match(object? data)
|
||||
|
||||
Reference in New Issue
Block a user