■ ■ ■ ■ ■ ■
Source/NETworkManager/Resources/Styles/MetroDialogStyles.xaml
1 | 1 | | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | | - | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | | - | xmlns:dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"> |
4 | | - | <Style x:Key="ProfileMetroDialog" TargetType="{x:Type dialog:BaseMetroDialog}" BasedOn="{StaticResource {x:Type dialog:BaseMetroDialog}}"> |
5 | | - | <Setter Property="Template"> |
6 | | - | <Setter.Value> |
7 | | - | <ControlTemplate TargetType="{x:Type dialog:BaseMetroDialog}"> |
8 | | - | <ControlTemplate.Resources> |
9 | | - | <Storyboard x:Key="DialogShownStoryboard"> |
10 | | - | <DoubleAnimation AccelerationRatio=".9" BeginTime="0:0:0" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.2" /> |
11 | | - | </Storyboard> |
12 | | - | </ControlTemplate.Resources> |
13 | | - | <Grid Background="{TemplateBinding Background}"> |
14 | | - | <Grid.RowDefinitions> |
15 | | - | <RowDefinition Height="Auto" /> |
16 | | - | <RowDefinition Height="*" MaxHeight="560" /> <!-- Adjust MaxHeight if Window.xaml MinHeight has changed -> 80% --> |
17 | | - | <RowDefinition Height="Auto" /> |
18 | | - | </Grid.RowDefinitions> |
19 | | - | <ContentPresenter Grid.Row="0" AutomationProperties.Name="Dialog top" Content="{TemplateBinding DialogTop}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
20 | | - | <Grid Grid.Row="1" > |
21 | | - | <Grid.ColumnDefinitions> |
22 | | - | <ColumnDefinition Width="10*" /> |
23 | | - | <ColumnDefinition Width="80*" MaxWidth="840" /> |
24 | | - | <!-- Adjust MaxHeight if Window.xaml MinWidth has changed -> 80% --> |
25 | | - | <ColumnDefinition Width="10*" /> |
26 | | - | </Grid.ColumnDefinitions> |
27 | | - | <!-- Content area --> |
28 | | - | <Grid Grid.Column="1" Margin="{TemplateBinding Padding}"> |
29 | | - | <Grid.RowDefinitions> |
30 | | - | <RowDefinition Height="Auto" /> |
31 | | - | <RowDefinition Height="*" /> |
32 | | - | </Grid.RowDefinitions> |
33 | | - | <TextBlock x:Name="PART_Title" Grid.Row="0" AutomationProperties.Name="Dialog title" FontSize="{TemplateBinding DialogTitleFontSize}" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Title}" TextWrapping="Wrap" /> |
34 | | - | <ContentPresenter Grid.Row="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" AutomationProperties.Name="Dialog content" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
35 | | - | </Grid> |
36 | | - | </Grid> |
37 | | - | <ContentPresenter Grid.Row="2" AutomationProperties.Name="Dialog bottom" Content="{TemplateBinding DialogBottom}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> |
38 | | - | </Grid> |
39 | | - | <ControlTemplate.Triggers> |
40 | | - | <Trigger Property="Title" Value="{x:Null}"> |
41 | | - | <Setter TargetName="PART_Title" Property="Visibility" Value="Collapsed" /> |
42 | | - | </Trigger> |
43 | | - | <EventTrigger RoutedEvent="Loaded"> |
44 | | - | <EventTrigger.Actions> |
45 | | - | <BeginStoryboard Storyboard="{StaticResource DialogShownStoryboard}" /> |
46 | | - | </EventTrigger.Actions> |
47 | | - | </EventTrigger> |
48 | | - | </ControlTemplate.Triggers> |
49 | | - | </ControlTemplate> |
50 | | - | </Setter.Value> |
51 | | - | </Setter> |
| 2 | + | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
| 3 | + | <ResourceDictionary.MergedDictionaries> |
| 4 | + | <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Buttons.xaml" /> |
| 5 | + | </ResourceDictionary.MergedDictionaries> |
| 6 | + | |
| 7 | + | <!-- Override the buttons in MahApps.Metro Dialogs --> |
| 8 | + | <Style x:Key="MahApps.Styles.Button.Dialogs" BasedOn="{StaticResource DefaultButton}" TargetType="{x:Type Button}"> |
| 9 | + | <Setter Property="VerticalAlignment" Value="Center" /> |
| 10 | + | <Setter Property="FontSize" Value="14" /> |
52 | 11 | | </Style> |
53 | 12 | | |
54 | | - | <Style TargetType="{x:Type dialog:CustomDialog}" BasedOn="{StaticResource ProfileMetroDialog}" /> |
55 | | - | |
56 | | - | <!-- Override the buttons in MahApps.Metro Dialogs --> |
57 | | - | <Style BasedOn="{StaticResource DefaultButton}" TargetType="{x:Type Button}" /> |
58 | | - | <Style x:Key="AccentedDialogSquareButton" BasedOn="{StaticResource HighlightedButton}" TargetType="{x:Type Button}" /> |
59 | | - | <Style x:Key="AccentedDialogHighlightedSquareButton" BasedOn="{StaticResource HighlightedButton}" TargetType="{x:Type Button}" /> |
| 13 | + | <Style x:Key="MahApps.Styles.Button.Dialogs.Accent" BasedOn="{StaticResource HighlightedButton}" TargetType="{x:Type Button}"> |
| 14 | + | <Setter Property="VerticalAlignment" Value="Center" /> |
| 15 | + | <Setter Property="FontSize" Value="14" /> |
| 16 | + | </Style> |
60 | 17 | | </ResourceDictionary> |