BililiveRecorder/BililiveRecorder.WPF/Controls/LogPanel.xaml

39 lines
1.9 KiB
Plaintext
Raw Normal View History

2021-02-23 18:03:37 +08:00
<UserControl x:Class="BililiveRecorder.WPF.Controls.LogPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BililiveRecorder.WPF.Controls"
xmlns:models="clr-namespace:BililiveRecorder.WPF.Models"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<ListView ItemsSource="{Binding}" SizeChanged="ListView_SizeChanged"
VirtualizingPanel.VirtualizationMode="Recycling"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.DataContext>
<models:LogModel/>
</ListView.DataContext>
<ListView.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ModernWpf;component/DensityStyles/Compact.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ListView.Resources>
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn DisplayMemberBinding="{Binding Timestamp,StringFormat=HH:mm:ss.ffff}"/>
<GridViewColumn DisplayMemberBinding="{Binding Level}"/>
<GridViewColumn DisplayMemberBinding="{Binding RoomId}"/>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Message}" TextWrapping="Wrap"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</UserControl>