Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@
}
break;
case JsonValueKind.Number:
var number = child.Value.AsValue().GetValue<int>();
<MudTreeViewItem T="string" Text="@child.Key" Icon="@Icons.Material.Filled.Numbers" EndText="@number.ToString()"></MudTreeViewItem>
JsonValue jsonVal = child.Value.AsValue();
string endText = string.Empty;
@* We try for int first, because an int can always be converted to double but not the other way around*@
if (jsonVal.TryGetValue<int>(out int intVal))
{
endText = intVal.ToString();
}
else if (jsonVal.TryGetValue<double>(out double doubleVal))
{
endText = doubleVal.ToString();
}
<MudTreeViewItem T="string" Text="@child.Key" Icon="@Icons.Material.Filled.Numbers" EndText="@endText"></MudTreeViewItem>
break;
case JsonValueKind.True:
<MudTreeViewItem T="string" Text="@child.Key" Icon="@Icons.Material.Filled.CheckBox" EndText="true"></MudTreeViewItem>
Expand Down