具备界面基础功能

This commit is contained in:
2026-01-01 22:40:32 +08:00
parent 0c86b4dad3
commit d039559402
81 changed files with 8333 additions and 1905 deletions

View File

@@ -0,0 +1,34 @@
using System.Globalization;
using System.Windows.Data;
namespace SHH.CameraDashboard
{
/// <summary>
/// 将订阅类型的 int 值 (0,1,2...) 转换为中文描述
/// </summary>
public class SubscriptionTypeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is int typeId)
{
return typeId switch
{
0 => "🖥️ 本地窗口预览",
1 => "📼 本地录像存储",
2 => "🪟 句柄绑定显示",
3 => "📡 网络转发传输",
4 => "🌐 网页端推流",
_ => $"未知类型 ({typeId})"
};
}
// 如果后端传回的是字符串枚举 (兼容性),也可以尝试转换
return value?.ToString() ?? "未知";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}