wenxiangchao
4 天以前 2e889843b4c171f2d6ad8e0d53084040703d11f6
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<ResourceDictionary 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d"
                    xmlns:ui="clr-namespace:HMI.UI"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:pw="https://opensource.panuon.com/wpf"
                    xmlns:pu="https://opensource.panuon.com/wpf-ui"
             xmlns:uic="clr-namespace:HMI.UI.Converter"
             xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI">
    <ResourceDictionary.MergedDictionaries>
        <pu:StyleDictionary Includes="ListView" />
        <ResourceDictionary Source="/HMI.UI;component/Resources/Font/Font.xaml"/>
        <ResourceDictionary Source="/HMI.UI;component/Style/ScrollBarResource.xaml"/>
    </ResourceDictionary.MergedDictionaries>
 
    <uic:ListViewRowNumberConverter x:Key="lvRowNumber"/>
 
    <uic:ListViewRowHeightConverter x:Key="sbC"/>
 
    <Style x:Key="CellBorder" TargetType="Border">
        <Setter Property="BorderBrush" Value="{DynamicResource CommonBoarder}"/>
        <Setter Property="BorderThickness" Value="1,0,0,0"/>
        <Setter Property="Margin" Value="-5,0"/>
        <Setter Property="Padding" Value="5,0,0,0"/>
        <Setter Property="Height" Value="{Binding ActualHeight,
            Mode=OneWay,
            RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=GridViewRowPresenter,AncestorLevel=1}}"/>
        <!--<Setter Property="Width" Value="{Binding ActualWidth,
            Converter={StaticResource sbC},ConverterParameter=2.0,
            RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ContentPresenter,AncestorLevel=1}}"/>-->
    </Style>
 
    <Style x:Key="ListTableTextBlock" TargetType="TextBlock">
        <Setter Property="Padding" Value="0,5"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
    </Style>
 
    <Style x:Key="DefaultListTableItemStyle" TargetType="ListViewItem" BasedOn="{StaticResource {x:Static pu:StyleKeys.ListViewItemStyle}}">
        <Setter Property="Background" Value="#FFF"/>
        <Style.Triggers>
            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                <Setter Property="Background" Value="#eeeeee"/>
            </Trigger>
        </Style.Triggers>
    </Style>
 
    <Style x:Key="DefaultListTable" TargetType="ListView" BasedOn="{StaticResource {x:Static pu:StyleKeys.ListViewStyle}}">
        <Style.Resources>
            <Style TargetType="ScrollBar" BasedOn="{StaticResource ScrollStyle_Mobile}"/>
        </Style.Resources>
 
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="VirtualizingPanel.IsVirtualizing" Value="True"/>
        <Setter Property="AlternationCount" Value="2"/>
        <Setter Property="pu:ListViewHelper.ColumnHeaderHeight" Value="36"/>
        <Setter Property="pu:ListViewHelper.ColumnHeaderBackground" Value="{DynamicResource VerBar}"/>
        <Setter Property="pu:ListViewHelper.ColumnHeaderHoverBackground" Value="{DynamicResource VerBar}"/>
        <Setter Property="pu:ListViewHelper.ColumnHeaderForeground" Value="#FFF"/>
        <Setter Property="pu:ListViewHelper.ItemsHoverBackground" Value="{DynamicResource SecondPrimaryColor}"/>
        <Setter Property="pu:ListViewHelper.ItemsHoverForeground" Value="{DynamicResource SecondPrimaryColorContract}"/>
        <Setter Property="pu:ListViewHelper.ItemsSelectedBackground" Value="{DynamicResource PrimaryColor}"/>
        <Setter Property="pu:ListViewHelper.ItemsSelectedForeground" Value="{DynamicResource PrimaryColorContract}"/>
        <Setter Property="pu:ListViewHelper.ItemsSeparatorBrush" Value="{DynamicResource CommonBoarder}"/>
        <Setter Property="pu:ListViewHelper.ItemsSeparatorThickness" Value="1"/>
        <Setter Property="pu:ListViewHelper.ItemsPadding" Value="0"/>
        <Setter Property="pu:ListViewHelper.ItemsHeight" Value="30"/>
        <Setter Property="pu:ListViewHelper.ItemsSeparatorVisibility" Value="Visible"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource DefaultListTableItemStyle}"/>
    </Style>
 
</ResourceDictionary>