Repository navigation
Expand file tree
/
Copy pathWpfMessageBox.xaml
More file actions
128 lines (128 loc) · 5.08 KB
/
Copy pathWpfMessageBox.xaml
File metadata and controls
128 lines (128 loc) · 5.08 KB
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
<Window
x:Class="TempFileCleaner.WpfMessageBox"
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:local="clr-namespace:TempFileCleaner"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Message"
Width="490"
Height="250"
AllowsTransparency="True"
Background="Transparent"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner"
WindowStyle="None">
<Window.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="#383838" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontFamily" Value="Aptos Mono" />
<Setter Property="Padding" Value="15,8" />
<Setter Property="FontSize" Value="16" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border
x:Name="border"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
CornerRadius="5">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#3498db" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="#2980b9" />
<!--<Setter TargetName="border" Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="0.97" ScaleY="0.97" />
</Setter.Value>
</Setter>-->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Border
Margin="6"
Background="#151515"
BorderBrush="DodgerBlue"
BorderThickness="2"
CornerRadius="8">
<Border.Effect>
<DropShadowEffect
BlurRadius="8"
Opacity="0.7"
ShadowDepth="4"
Color="#000000" />
</Border.Effect>
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image
x:Name="imgOk"
Grid.Row="0"
Width="36"
Height="36"
Margin="-10"
HorizontalAlignment="Left"
Opacity="0.9"
RenderOptions.BitmapScalingMode="Fant"
Source="/Logo_Normal.png"
Visibility="Visible" />
<Image
x:Name="imgErr"
Grid.Row="0"
Width="36"
Height="36"
Margin="-10"
HorizontalAlignment="Left"
Opacity="0.9"
RenderOptions.BitmapScalingMode="Fant"
Source="/Logo_Warn.png"
Visibility="Collapsed" />
<TextBlock
x:Name="MessageText"
Grid.Row="1"
Margin="8,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Text="Message Here"
TextWrapping="Wrap" />
<StackPanel
Grid.Row="2"
Margin="0,10,0,-1"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
x:Name="btnOK"
Width="90"
Height="34"
Click="Ok_Click"
Content="OK"
IsDefault="True" />
<Button
x:Name="btnCancel"
Width="90"
Height="34"
Margin="6,0,0,0"
Click="Cancel_Click"
Content="Cancel"
IsDefault="False" />
</StackPanel>
</Grid>
</Border>
</Window>