FastGithub/FastGithub.UI/LogListBox.xaml
2021-11-02 14:14:57 +08:00

33 lines
1.6 KiB
XML

<UserControl x:Class="FastGithub.UI.LogListBox"
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:FastGithub.UI"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<ListBox
ItemsSource="{Binding LogList}"
VirtualizingPanel.IsVirtualizing="True"
ScrollViewer.CanContentScroll="True"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
BorderThickness="0"
Background="#f7f7f7">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0 5" >
<TextBlock TextWrapping="Wrap" Text="{Binding Timestamp, StringFormat={}{0:yyyy-MM-dd HH:mm:ss.fff}}"/>
<TextBlock TextWrapping="Wrap" FontSize="12" Margin="0 5" Text="{Binding SourceContext}"/>
<TextBlock TextWrapping="Wrap" FontSize="14" FontWeight="Light" Text="{Binding Message}">
<TextBlock.Foreground>
<SolidColorBrush Color="{Binding Color}"/>
</TextBlock.Foreground>
</TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>