From 2da0733bdfb051333aa7bd70064d545c8178b228 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:29:56 +0800 Subject: [PATCH] feat: add Type column. --- demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml | 15 +++++++++++++-- .../ViewModels/VariablesDemoViewModel.cs | 4 +++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml index f9b7f9d..151ee54 100644 --- a/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml @@ -32,6 +32,19 @@ + + + + + + + @@ -55,7 +67,6 @@ diff --git a/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs b/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs index b9e4d70..583919f 100644 --- a/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs +++ b/demo/Semi.Avalonia.Demo/ViewModels/VariablesDemoViewModel.cs @@ -21,6 +21,7 @@ public class VariablesDemoViewModel : ObservableObject { if (token.ResourceKey is not null && dictionary.TryGetValue(token.ResourceKey, out var value)) { + token.Type = value?.GetType(); token.Value = GetValueString(value); } } @@ -104,8 +105,9 @@ public class VariableItem() { public string? Category { get; set; } public string? ResourceKey { get; set; } - public string? Description { get; set; } + public Type? Type { get; set; } public string? Value { get; set; } + public string? Description { get; set; } public VariableItem(string category, string resourceKey, string description = "") : this() {