<UserControl x:Class="Bro.UI.Ctrls.LogCtrl"
|
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:Bro.UI.Ctrls"
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
mc:Ignorable="d"
|
d:DesignHeight="450" d:DesignWidth="300">
|
<UserControl.Resources>
|
<sys:String x:Key="minus10">-35</sys:String>
|
<Style TargetType="ListViewItem">
|
<Style.Triggers>
|
<Trigger Property="ListView.AlternationIndex" Value="1">
|
<Setter Property="Background" Value="#FFCFEDF7"/>
|
</Trigger>
|
<Trigger Property="ListView.AlternationIndex" Value="0">
|
<Setter Property="Background" Value="GhostWhite"/>
|
</Trigger>
|
</Style.Triggers>
|
</Style>
|
<Style TargetType="ListView">
|
<Setter Property="AlternationCount" Value="2"/>
|
</Style>
|
</UserControl.Resources>
|
<Grid>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="*"/>
|
<RowDefinition Height="45"/>
|
</Grid.RowDefinitions>
|
<ListView x:Name="lvLog" BorderThickness="0" Grid.Row="0">
|
<ListView.ItemTemplate>
|
<DataTemplate>
|
<TextBlock Text="{Binding Path=.}" Margin="5,5,0,5" TextWrapping="Wrap" HorizontalAlignment="Left" MinWidth="180" MaxWidth="{Binding ElementName=lvLog, Path=ActualWidth,Converter={StaticResource simpleCalculation},ConverterParameter={StaticResource minus10}}"/>
|
</DataTemplate>
|
</ListView.ItemTemplate>
|
</ListView>
|
<Button Grid.Row="1" Margin="3,0,3,0" Click="Button_Click">
|
<StackPanel Orientation="Horizontal">
|
<iconPacks:PackIconModern Kind="Clean" VerticalAlignment="Stretch" Width="24"/>
|
<TextBlock Text="清除日志" Margin="5,0,0,0" FontSize="15"/>
|
</StackPanel>
|
</Button>
|
</Grid>
|
</UserControl>
|