chr
2025-02-24 104cad5ee53eb05d3a89d508a029425726ae89ae
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:pw="https://opensource.panuon.com/wpf"
            xmlns:pu="https://opensource.panuon.com/wpf-ui">
 
    <ResourceDictionary.MergedDictionaries>
        <pu:StyleDictionary Includes="TextBox,ComboBox,Button" />
    </ResourceDictionary.MergedDictionaries>
 
    <Style x:Key="ModalButton" TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXModalDialog.ButtonStyleKey}}">
        <Setter Property="pu:ButtonHelper.PendingSpinStyle">
            <Setter.Value>
                <Style TargetType="pu:Spin" BasedOn="{StaticResource {x:Static pu:ButtonHelper.PendingSpinStyleKey}}">
                    <Setter Property="SpinStyle" Value="Ring2" />
                </Style>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="pu:ButtonHelper.IsPending" Value="True">
                <Setter Property="pu:ButtonHelper.ClickEffect" Value="Shake" />
                <Setter Property="ContentTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="请稍后..." />
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Tag" Value="OK">
                <Setter Property="Background" Value="{StaticResource PrimaryColor}" />
                <Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}" />
                <Setter Property="Padding" Value="20,0" />
                <Setter Property="Height" Value="35" />
            </Trigger>
            <Trigger Property="Tag" Value="Cancel">
                <Setter Property="Background" Value="{x:Null}" />
                <Setter Property="Foreground" Value="Gray" />
                <Setter Property="Cursor" Value="Hand" />
                <Setter Property="Padding" Value="10,0" />
                <Setter Property="ContentTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" TextDecorations="Underline" />
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
 
 
    <Style x:Key="SearchButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
        <Setter Property="pu:ButtonHelper.CornerRadius" Value="0" />
        <Setter Property="Background" Value="{StaticResource PrimaryColor}" />
        <Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}" />
        <Setter Property="FontFamily" Value="{StaticResource iconfont}" />
        <Setter Property="Height" Value="35" />
        <Setter Property="Content" Value="&#xe752;"/>
        <Setter Property="pu:ButtonHelper.PendingSpinStyle">
            <Setter.Value>
                <Style TargetType="pu:Spin" BasedOn="{StaticResource {x:Static pu:ButtonHelper.PendingSpinStyleKey}}">
                    <Setter Property="SpinStyle" Value="Ring2" />
                </Style>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="pu:ButtonHelper.IsPending" Value="True">
                <Setter Property="pu:ButtonHelper.ClickEffect" Value="Shake" />
                <Setter Property="ContentTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="Click again ?" />
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>
 
    <Style x:Key="EditorTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="pu:TextBoxHelper.FocusedBorderBrush" Value="#6CBCEA" />
        <Setter Property="pu:TextBoxHelper.FocusedShadowColor" Value="#6CBCEA" />
        <Setter Property="pu:TextBoxHelper.CornerRadius" Value="0" />
        <Setter Property="pu:TextBoxHelper.WatermarkForeground" Value="#4A4A4A" />
        <Setter Property="pu:TextBoxHelper.FocusedWatermarkForeground" Value="#AAAAAA" />
        <Setter Property="Height" Value="35" />
        <Setter Property="Padding" Value="5,0" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Style.Triggers>
            <Trigger Property="IsReadOnly" Value="True">
                <Setter Property="Background" Value="LightGray"/>
            </Trigger>
        </Style.Triggers>
    </Style>
 
    <Style x:Key="MultilineEditorTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource EditorTextBoxStyle}">
        <Setter Property="Height" Value="100" />
        <Setter Property="Padding" Value="5,10" />
        <Setter Property="AcceptsReturn" Value="True" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
    </Style>
 
    <Style x:Key="InputFormGroupStyle" TargetType="pu:FormGroup">
        <Style.Resources>
            <Style TargetType="TextBox" BasedOn="{StaticResource EditorTextBoxStyle}">
                
            </Style>
        </Style.Resources>
        <Setter Property="HeaderWidth" Value="70" />
        <Setter Property="HeaderHeight" Value="35" />
        <Setter Property="Orientation" Value="Horizontal" />
        <Setter Property="Margin" Value="0,10,0,0" />
    </Style>
 
    <Style x:Key="RequiredInputFormGroupStyle" TargetType="pu:FormGroup" BasedOn="{StaticResource InputFormGroupStyle}">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="*" Foreground="Red" />
                        <ContentControl Content="{Binding}" />
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
    <Style x:Key="FormComboxStyle" TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
        <Setter Property="pu:ComboBoxHelper.CornerRadius" Value="0"/>
        <Setter Property="pu:ComboBoxHelper.ItemsHoverBackground" Value="{StaticResource WindowBar}"/>
        <Setter Property="pu:ComboBoxHelper.ItemsHoverForeground" Value="#FFF"/>
        <Setter Property="pu:ComboBoxHelper.ItemsSelectedForeground" Value="Black"/>
        <Setter Property="pu:ComboBoxHelper.HoverBorderBrush" Value="#007ACC" />
        <Setter Property="pu:ComboBoxHelper.FocusedBorderBrush" Value="#007ACC" />
        <Setter Property="Height" Value="35" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="Background" Value="#FFF" />
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="SelectedValuePath" Value="Content"/>
    </Style>
</ResourceDictionary>