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.Value>
<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 />
</ScrollViewer>
</ControlTemplate>
@@ -30,10 +31,6 @@
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TextBlock}" x:Key="TextBlockBaseStyle">
<Setter Property="FontFamily" Value="Consolas" />
</Style>
<DataTemplate DataType="{x:Type viewModels:LogEntry}">
<Grid IsSharedSizeScope="True">
@@ -43,10 +40,16 @@
</Grid.ColumnDefinitions>
<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"
TextWrapping="Wrap" Style="{StaticResource TextBlockBaseStyle}" Foreground="{Binding Color}" />
<TextBox Grid.Column="1"
Text="{Binding Message, Mode=OneWay}"
TextWrapping="Wrap"
FontFamily="Consolas"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
Foreground="{Binding Color}" />
</Grid>
</DataTemplate>
</UserControl.Resources>