Skip to content

Commit 801fd40

Browse files
committed
update demo;
1 parent 8f3ff1d commit 801fd40

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
using System.Text.Json.Serialization;
22

3-
namespace CodeWF.Tools.AvaloniaDemo.Models
3+
namespace CodeWF.Tools.AvaloniaDemo.Models;
4+
5+
public class ClassWithEnum
46
{
5-
public class ClassWithEnum
6-
{
7-
public int Id { get; set; }
8-
public string? Name { get; set; }
7+
public int Id { get; set; }
8+
public string? Name { get; set; }
99

10-
public TestEnum Type { get; set; }
11-
}
10+
public TestEnum Type { get; set; }
11+
}
1212

13-
[JsonConverter(typeof(JsonStringEnumConverter<TestEnum>))]
14-
public enum TestEnum
15-
{
16-
Light,
17-
Dark
18-
}
13+
[JsonConverter(typeof(JsonStringEnumConverter<TestEnum>))]
14+
public enum TestEnum
15+
{
16+
Light,
17+
Dark
1918
}

src/CodeWF.Tools.AvaloniaDemo/Views/MainView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<StackPanel>
3535
<Button Content="一般类" Click="SerialNormalClass_OnClick" />
3636
<Button Content="枚举类" Click="SerialClassWithEnum_OnClick" />
37-
<SelectableTextBlock Name="TxtJsonStr"></SelectableTextBlock>
37+
<SelectableTextBlock Name="TxtJsonStr" TextWrapping="Wrap"/>
3838
</StackPanel>
3939
</TabItem>
4040
</TabControl>

0 commit comments

Comments
 (0)