/
MessageDialog.xaml
54 lines (53 loc) · 3.27 KB
/
MessageDialog.xaml
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
<Dialogs:BaseMetroDialog x:Class="MahApps.Metro.Controls.Dialogs.MessageDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs">
<Dialogs:BaseMetroDialog.CommandBindings>
<CommandBinding Command="Copy" Executed="OnKeyCopyExecuted" />
</Dialogs:BaseMetroDialog.CommandBindings>
<Grid Margin="0 10 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollViewer x:Name="PART_MessageScrollViewer"
FocusVisualStyle="{x:Null}"
Focusable="False"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<TextBlock x:Name="PART_MessageTextBlock"
Margin="0 5 0 0"
FontSize="{Binding DialogMessageFontSize, RelativeSource={RelativeSource AncestorType=Dialogs:MessageDialog, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged}"
Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Dialogs:MessageDialog, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged}"
Text="{Binding Message, RelativeSource={RelativeSource AncestorType=Dialogs:MessageDialog, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
</ScrollViewer>
<StackPanel Grid.Row="1"
Height="85"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button x:Name="PART_AffirmativeButton"
Height="35"
MinWidth="80"
Margin="0 0 5 0"
Content="{Binding AffirmativeButtonText, RelativeSource={RelativeSource AncestorType=Dialogs:MessageDialog, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged}" />
<Button x:Name="PART_NegativeButton"
Height="35"
MinWidth="80"
Margin="5 0 5 0"
Content="{Binding NegativeButtonText, RelativeSource={RelativeSource AncestorType=Dialogs:MessageDialog, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged}" />
<Button x:Name="PART_FirstAuxiliaryButton"
Height="35"
MinWidth="80"
Margin="5 0 5 0"
Content="{Binding FirstAuxiliaryButtonText, RelativeSource={RelativeSource AncestorType=Dialogs:MessageDialog, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged}"
Visibility="Collapsed" />
<Button x:Name="PART_SecondAuxiliaryButton"
Height="35"
MinWidth="80"
Margin="5 0 0 0"
Content="{Binding SecondAuxiliaryButtonText, RelativeSource={RelativeSource AncestorType=Dialogs:MessageDialog, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged}"
Visibility="Collapsed" />
</StackPanel>
</Grid>
</Dialogs:BaseMetroDialog>