mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-12 04:06:35 +08:00
feat: add Type column.
This commit is contained in:
@@ -32,6 +32,19 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn
|
||||||
|
Width="200"
|
||||||
|
x:DataType="vm:VariableItem"
|
||||||
|
Header="Type">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
|
<SelectableTextBlock
|
||||||
|
Margin="12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Type.Name}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
<DataGridTemplateColumn
|
<DataGridTemplateColumn
|
||||||
Width="200"
|
Width="200"
|
||||||
x:DataType="vm:VariableItem"
|
x:DataType="vm:VariableItem"
|
||||||
@@ -40,7 +53,6 @@
|
|||||||
<DataTemplate DataType="vm:VariableItem">
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
Margin="12,0"
|
Margin="12,0"
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding Value}"
|
Text="{Binding Value}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
@@ -55,7 +67,6 @@
|
|||||||
<DataTemplate DataType="vm:VariableItem">
|
<DataTemplate DataType="vm:VariableItem">
|
||||||
<SelectableTextBlock
|
<SelectableTextBlock
|
||||||
Margin="12,0"
|
Margin="12,0"
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding Description}"
|
Text="{Binding Description}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class VariablesDemoViewModel : ObservableObject
|
|||||||
{
|
{
|
||||||
if (token.ResourceKey is not null && dictionary.TryGetValue(token.ResourceKey, out var value))
|
if (token.ResourceKey is not null && dictionary.TryGetValue(token.ResourceKey, out var value))
|
||||||
{
|
{
|
||||||
|
token.Type = value?.GetType();
|
||||||
token.Value = GetValueString(value);
|
token.Value = GetValueString(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,8 +105,9 @@ public class VariableItem()
|
|||||||
{
|
{
|
||||||
public string? Category { get; set; }
|
public string? Category { get; set; }
|
||||||
public string? ResourceKey { get; set; }
|
public string? ResourceKey { get; set; }
|
||||||
public string? Description { get; set; }
|
public Type? Type { get; set; }
|
||||||
public string? Value { get; set; }
|
public string? Value { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
|
||||||
public VariableItem(string category, string resourceKey, string description = "") : this()
|
public VariableItem(string category, string resourceKey, string description = "") : this()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user