alielie
2025-08-25 c4a3f8db90530a727ffab77c3bb5bb7d782792bf
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
153
<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:MessageBoxXSettings x:Key="MsgBoxWarn" 
                                 InteropOwnersMask="True"
                                 InverseButtonsSequence="False">
        <pu:MessageBoxXSettings.WindowXStyle>
            <Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
                <Setter Property="pu:WindowXCaption.Background" Value="{StaticResource WarningColor}" />
                <Setter Property="pu:WindowXCaption.Foreground" Value="{StaticResource WarningColorContract}" />
                <Setter Property="Width" Value="350" />
                <Setter Property="Height" Value="200" />
                <Setter Property="SizeToContent" Value="Manual" />
            </Style>
        </pu:MessageBoxXSettings.WindowXStyle>
 
        <pu:MessageBoxXSettings.ButtonStyle>
            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:MessageBoxX.ButtonStyleKey}}">
 
                <Style.Triggers>
                    <Trigger Property="Tag" Value="OK">
                        <Setter Property="Foreground" Value="{StaticResource WarningColorContract}" />
                        <Setter Property="Background" Value="{StaticResource 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="{Binding}" TextDecorations="Underline" />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </pu:MessageBoxXSettings.ButtonStyle>
    </pu:MessageBoxXSettings>
 
    <pu:MessageBoxXSettings x:Key="MsgBoxError" 
                             InteropOwnersMask="True"
                             InverseButtonsSequence="False">
        <pu:MessageBoxXSettings.WindowXStyle>
            <Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
                <Setter Property="pu:WindowXCaption.Background" Value="{StaticResource DangerColor}" />
                <Setter Property="pu:WindowXCaption.Foreground" Value="{StaticResource DangerColorContrast}" />
                <Setter Property="Width" Value="350" />
                <Setter Property="Height" Value="200" />
                <Setter Property="SizeToContent" Value="Manual" />
            </Style>
        </pu:MessageBoxXSettings.WindowXStyle>
 
        <pu:MessageBoxXSettings.ButtonStyle>
            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:MessageBoxX.ButtonStyleKey}}">
 
                <Style.Triggers>
                    <Trigger Property="Tag" Value="OK">
                        <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}" />
                        <Setter Property="Background" Value="{StaticResource 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="{Binding}" TextDecorations="Underline" />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </pu:MessageBoxXSettings.ButtonStyle>
    </pu:MessageBoxXSettings>
 
    <pu:MessageBoxXSettings x:Key="MsgBoxInfo" 
                             InteropOwnersMask="True"
                             InverseButtonsSequence="False">
        <pu:MessageBoxXSettings.WindowXStyle>
            <Style TargetType="pu:WindowX" BasedOn="{StaticResource {x:Static pu:MessageBoxX.WindowXStyleKey}}">
                <Setter Property="pu:WindowXCaption.Background" Value="{StaticResource PrimaryColor}" />
                <Setter Property="pu:WindowXCaption.Foreground" Value="{StaticResource PrimaryColorContract}" />
                <Setter Property="Width" Value="350" />
                <Setter Property="Height" Value="200" />
                <Setter Property="SizeToContent" Value="Manual" />
            </Style>
        </pu:MessageBoxXSettings.WindowXStyle>
 
        <pu:MessageBoxXSettings.ButtonStyle>
            <Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:MessageBoxX.ButtonStyleKey}}">
 
                <Style.Triggers>
                    <Trigger Property="Tag" Value="OK">
                        <Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}" />
                        <Setter Property="Background" Value="{StaticResource 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="{Binding}" TextDecorations="Underline" />
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </pu:MessageBoxXSettings.ButtonStyle>
    </pu:MessageBoxXSettings>
 
    <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="{StaticResource SuccessColor}" />
                <Setter Property="Foreground" Value="{StaticResource 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="{StaticResource WarningColor}" />
                <Setter Property="Foreground" Value="{StaticResource 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="{StaticResource DangerColor}" />
                <Setter Property="Foreground" Value="{StaticResource DangerColorContrast}" />
            </Style>
        </pu:ToastSetting.LabelStyle>
    </pu:ToastSetting>
</ResourceDictionary>