feat: initialize project

This commit is contained in:
yyc12345 committed 2026-09-29 20:16:52 +08:00
commit 8194faa2c8
15 files changed
+1025

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
using System;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using YKanBan.ViewModels;
namespace YKanBan;
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);
if (type != null)
{
return (Control)Activator.CreateInstance(type)!;
}
return new TextBlock { Text = "Not Found: " + name };
}
public bool Match(object? data)
{
return data is ViewModelBase;
}
}