allow selection for log lines

This commit is contained in:
zznty
2022-10-09 17:51:45 +07:00
parent f8a3647308
commit 49f68a8fcc

View File

@@ -15,7 +15,8 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate> <ControlTemplate>
<ScrollViewer CanContentScroll="True" ScrollChanged="ScrollViewer_OnScrollChanged" Loaded="ScrollViewer_OnLoaded" Unloaded="ScrollViewer_OnUnloaded"> <ScrollViewer CanContentScroll="True" ScrollChanged="ScrollViewer_OnScrollChanged"
Loaded="ScrollViewer_OnLoaded" Unloaded="ScrollViewer_OnUnloaded">
<ItemsPresenter /> <ItemsPresenter />
</ScrollViewer> </ScrollViewer>
</ControlTemplate> </ControlTemplate>
@@ -31,10 +32,6 @@
</Setter> </Setter>
</Style> </Style>
<Style TargetType="{x:Type TextBlock}" x:Key="TextBlockBaseStyle">
<Setter Property="FontFamily" Value="Consolas" />
</Style>
<DataTemplate DataType="{x:Type viewModels:LogEntry}"> <DataTemplate DataType="{x:Type viewModels:LogEntry}">
<Grid IsSharedSizeScope="True"> <Grid IsSharedSizeScope="True">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -43,10 +40,16 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding Timestamp, StringFormat=HH:mm:ss.fff}" Grid.Column="0" <TextBlock Text="{Binding Timestamp, StringFormat=HH:mm:ss.fff}" Grid.Column="0"
FontWeight="Bold" Style="{StaticResource TextBlockBaseStyle}" Foreground="{Binding Color}" Margin="5,0,5,0" /> FontWeight="Bold" FontFamily="Consolas" Foreground="{Binding Color}" Margin="5,0,5,0" />
<TextBlock Text="{Binding Message}" Grid.Column="1" <TextBox Grid.Column="1"
TextWrapping="Wrap" Style="{StaticResource TextBlockBaseStyle}" Foreground="{Binding Color}" /> Text="{Binding Message, Mode=OneWay}"
TextWrapping="Wrap"
FontFamily="Consolas"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Foreground="{Binding Color}" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</UserControl.Resources> </UserControl.Resources>