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"/>
|
<TextBox x:Name="txtClientName" IsReadOnly="True" Background="#3D3D3D" Foreground="White" Margin="0,0,0,15"/>
|
||||||
|
|
||||||
<TextBlock Text="Записи:" Margin="0,5" Foreground="White"/>
|
<TextBlock Text="Записи:" Margin="0,5" Foreground="White"/>
|
||||||
<ListBox x:Name="RecordsListBox" Height="150" Background="#2D2D2D" Foreground="White" BorderBrush="White">
|
<ListBox x:Name="RecordsListBox" Height="150" Background="#2D2D2D" Foreground="White" BorderBrush="White" DisplayMemberPath="DateEntry">
|
||||||
<ListBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
|
|
||||||
</DataTemplate>
|
|
||||||
</ListBox.ItemTemplate>
|
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<!-- Кнопки управления -->
|
<!-- Кнопки управления -->
|
||||||
|
|||||||
@@ -39,7 +39,14 @@ namespace WpfApp1
|
|||||||
if (File.Exists(FilePath))
|
if (File.Exists(FilePath))
|
||||||
{
|
{
|
||||||
string json = File.ReadAllText(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();
|
RefreshList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user