From 8c8befe9ca32b80ed12242acb2bbecfb336d16b5 Mon Sep 17 00:00:00 2001
From: estrogen elf <87099578+BlossomiShymae@users.noreply.github.com>
Date: Mon, 16 Jun 2025 01:00:27 -0500
Subject: [PATCH] refactor: use LRU for control cache
---
Needlework.Net/Needlework.Net.csproj | 1 +
Needlework.Net/ViewLocator.cs | 52 +++++++++++++++++++++++++---
2 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/Needlework.Net/Needlework.Net.csproj b/Needlework.Net/Needlework.Net.csproj
index 7cde83f..0da5007 100644
--- a/Needlework.Net/Needlework.Net.csproj
+++ b/Needlework.Net/Needlework.Net.csproj
@@ -27,6 +27,7 @@
+
diff --git a/Needlework.Net/ViewLocator.cs b/Needlework.Net/ViewLocator.cs
index c1c6949..7ba73ea 100644
--- a/Needlework.Net/ViewLocator.cs
+++ b/Needlework.Net/ViewLocator.cs
@@ -1,8 +1,12 @@
using Avalonia.Controls;
using Avalonia.Controls.Templates;
+using Avalonia.VisualTree;
+using BitFaster.Caching;
+using BitFaster.Caching.Lru;
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
@@ -10,7 +14,46 @@ namespace Needlework.Net
{
public class ViewLocator : IDataTemplate
{
- private readonly Dictionary