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