领胜LDS 键盘AOI检测项目
xcd
2020-06-24 d6c577e17ee7bb5331dd51d803f9b42441b0f0e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<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>