Working ver.1.2
This commit is contained in:
@@ -13,12 +13,8 @@
|
||||
<TextBox x:Name="txtClientName" IsReadOnly="True" Background="#3D3D3D" Foreground="White" Margin="0,0,0,15"/>
|
||||
|
||||
<TextBlock Text="Записи:" Margin="0,5" Foreground="White"/>
|
||||
<ListBox x:Name="RecordsListBox" Height="150" Background="#2D2D2D" Foreground="White" BorderBrush="White">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ListBox x:Name="RecordsListBox" Height="150" Background="#2D2D2D" Foreground="White" BorderBrush="White" DisplayMemberPath="DateEntry">
|
||||
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<!-- Кнопки управления -->
|
||||
|
||||
@@ -39,7 +39,14 @@ namespace WpfApp1
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
string json = File.ReadAllText(FilePath);
|
||||
_allEntries = JsonSerializer.Deserialize<List<Entry>>(json) ?? new List<Entry>();
|
||||
|
||||
// Добавляем настройки
|
||||
var options = new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
|
||||
_allEntries = JsonSerializer.Deserialize<List<Entry>>(json, options) ?? new List<Entry>();
|
||||
}
|
||||
RefreshList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user