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
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
149
150
151
152
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:pw="https://opensource.panuon.com/wpf"
                        xmlns:pu="https://opensource.panuon.com/wpf-ui"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:puconfig="clr-namespace:Panuon.WPF.UI.Configurations;assembly=Panuon.WPF.UI">
    <pu:MessageBoxXSetting x:Key="MsgBoxWarn" 
         InteropOwnersMask="False"
         InverseButtonsSequence="False">
        <pu:MessageBoxXSetting.WindowXStyle>
            <Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
                <Setter Property="pu:WindowXCaption.Background" Value="{DynamicResource WarningColor}" />
                <Setter Property="pu:WindowXCaption.Foreground" Value="{DynamicResource WarningColorContract}" />
                <Setter Property="Width" Value="350" />
                <Setter Property="Height" Value="200" />
                <Setter Property="SizeToContent" Value="Manual" />
            </Style>
        </pu:MessageBoxXSetting.WindowXStyle>
 
        <pu:MessageBoxXSetting.ButtonStyle>
            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:MessageBoxX.ButtonStyleKey}}">
 
                <Style.Triggers>
                    <Trigger Property="Tag" Value="OK">
                        <Setter Property="Foreground" Value="{DynamicResource WarningColorContract}" />
                        <Setter Property="Background" Value="{DynamicResource WarningColor}" />
                    </Trigger>
 
                    <Trigger Property="Tag" Value="Cancel">
                        <Setter Property="Background" Value="{x:Null}" />
                        <Setter Property="Foreground" Value="Gray" />
                        <Setter Property="Cursor" Value="Hand" />
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <TextBlock Text="{DynamicResource App.Cancel}" TextDecorations="Underline" />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </pu:MessageBoxXSetting.ButtonStyle>
    </pu:MessageBoxXSetting>
 
    <pu:MessageBoxXSetting x:Key="MsgBoxError" 
     InteropOwnersMask="False"
     InverseButtonsSequence="False">
        <pu:MessageBoxXSetting.WindowXStyle>
            <Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
                <Setter Property="pu:WindowXCaption.Background" Value="{DynamicResource DangerColor}" />
                <Setter Property="pu:WindowXCaption.Foreground" Value="{DynamicResource DangerColorContrast}" />
                <Setter Property="Width" Value="350" />
                <Setter Property="Height" Value="200" />
                <Setter Property="SizeToContent" Value="Manual" />
            </Style>
        </pu:MessageBoxXSetting.WindowXStyle>
 
        <pu:MessageBoxXSetting.ButtonStyle>
            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:MessageBoxX.ButtonStyleKey}}">
 
                <Style.Triggers>
                    <Trigger Property="Tag" Value="OK">
                        <Setter Property="Foreground" Value="{DynamicResource DangerColorContrast}" />
                        <Setter Property="Background" Value="{DynamicResource DangerColor}" />
                    </Trigger>
 
                    <Trigger Property="Tag" Value="Cancel">
                        <Setter Property="Background" Value="{x:Null}" />
                        <Setter Property="Foreground" Value="Gray" />
                        <Setter Property="Cursor" Value="Hand" />
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <TextBlock Text="{DynamicResource App.Cancel}" TextDecorations="Underline" />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </pu:MessageBoxXSetting.ButtonStyle>
    </pu:MessageBoxXSetting>
 
    <pu:MessageBoxXSetting x:Key="MsgBoxInfo" 
     InteropOwnersMask="False"
     InverseButtonsSequence="False">
        <pu:MessageBoxXSetting.WindowXStyle>
            <Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
                <Setter Property="pu:WindowXCaption.Background" Value="{DynamicResource PrimaryColor}" />
                <Setter Property="pu:WindowXCaption.Foreground" Value="{DynamicResource PrimaryColorContract}" />
                <Setter Property="Width" Value="350" />
                <Setter Property="Height" Value="200" />
                <Setter Property="SizeToContent" Value="Manual" />
            </Style>
        </pu:MessageBoxXSetting.WindowXStyle>
 
        <pu:MessageBoxXSetting.ButtonStyle>
            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:MessageBoxX.ButtonStyleKey}}">
 
                <Style.Triggers>
                    <Trigger Property="Tag" Value="OK">
                        <Setter Property="Foreground" Value="{DynamicResource PrimaryColorContract}" />
                        <Setter Property="Background" Value="{DynamicResource PrimaryColor}" />
                    </Trigger>
 
                    <Trigger Property="Tag" Value="Cancel">
                        <Setter Property="Background" Value="{x:Null}" />
                        <Setter Property="Foreground" Value="Gray" />
                        <Setter Property="Cursor" Value="Hand" />
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <TextBlock Text="{DynamicResource App.Cancel}" TextDecorations="Underline" />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </pu:MessageBoxXSetting.ButtonStyle>
    </pu:MessageBoxXSetting>
 
    <pu:ToastSetting x:Key="toastSuccess" Spacing="25">
        <pu:ToastSetting.LabelStyle>
            <Style TargetType="Label" BasedOn="{StaticResource {x:Static pu:Toast.LabelStyleKey}}">
                <Setter Property="FontSize" Value="18" />
                <Setter Property="Background" Value="{DynamicResource SuccessColor}" />
                <Setter Property="Foreground" Value="{DynamicResource SuccessColorContrast}" />
            </Style>
        </pu:ToastSetting.LabelStyle>
    </pu:ToastSetting>
 
    <pu:ToastSetting x:Key="toastWarning" Spacing="25">
        <pu:ToastSetting.LabelStyle>
            <Style TargetType="Label" BasedOn="{StaticResource {x:Static pu:Toast.LabelStyleKey}}">
                <Setter Property="FontSize" Value="18" />
                <Setter Property="Background" Value="{DynamicResource WarningColor}" />
                <Setter Property="Foreground" Value="{DynamicResource SuccessColorContrast}" />
            </Style>
        </pu:ToastSetting.LabelStyle>
    </pu:ToastSetting>
 
    <pu:ToastSetting x:Key="toastError" Spacing="25">
        <pu:ToastSetting.LabelStyle>
            <Style TargetType="Label" BasedOn="{StaticResource {x:Static pu:Toast.LabelStyleKey}}">
                <Setter Property="FontSize" Value="18" />
                <Setter Property="Background" Value="{DynamicResource DangerColor}" />
                <Setter Property="Foreground" Value="{DynamicResource DangerColorContrast}" />
            </Style>
        </pu:ToastSetting.LabelStyle>
    </pu:ToastSetting>
</ResourceDictionary>