Idk, dev work goin on

This commit is contained in:
2026-09-09 16:19:45 +03:00 Unverified
parent b0d8bcd742
commit 17a0a9f7a6
318 changed files with 11908 additions and 81 deletions
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using WinWARP.Core.ViewModels.Wrappers;
namespace WinWARP.Ui.Helpers;
/// <summary>
/// A DataTemplateSelector that selects the appropriate DataTemplate based on the type of server item (StandaloneServerViewModel or SubscriptionServerViewModel).
/// </summary>
public class ServerTemplateSelector : DataTemplateSelector
{
public DataTemplate StandaloneTemplate
{
get; set;
}
public DataTemplate SubscriptionTemplate
{
get; set;
}
protected override DataTemplate SelectTemplateCore(object item)
{
// Evaluate the type of the item currently being rendered in the list row
return item switch
{
StandaloneServerViewModel => StandaloneTemplate,
SubscriptionServerViewModel => SubscriptionTemplate,
_ => base.SelectTemplateCore(item) // Fallback if type doesn't match
};
}
}