WIP Tooltip code

This commit is contained in:
6d486f49
2025-11-05 15:11:55 -05:00
parent 3696f474e9
commit 86580a9f5d
6 changed files with 211 additions and 15 deletions
+54
View File
@@ -0,0 +1,54 @@
using Model.Feedback;
namespace Services.Website;
public class TooltipService : ITooltipService
{
private readonly List<TooltipModel> tooltips = new();
public void Subscribe(Action action)
{
OnChange += action;
}
public void Unsubscribe(Action action)
{
OnChange += action;
}
public void AddTooltip(TooltipModel tooltip)
{
tooltips.Insert(0, tooltip);
NotifyDataChanged();
}
public void RemoveTooltip(TooltipModel tooltip)
{
tooltips.Remove(tooltip);
}
public bool HasTooltips()
{
return tooltips.Count > 0;
}
public List<TooltipModel> GetTooltips()
{
return tooltips;
}
public void ClearAllTooltips()
{
tooltips.Clear();
NotifyDataChanged();
}
private event Action OnChange = null!;
private void NotifyDataChanged()
{
OnChange();
}
}