Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@Keboo @Mrxx99
389 lines (383 sloc) 30.6 KB
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
xmlns:controlzEx="clr-namespace:ControlzEx">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Font.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="MaterialDesignDialogHostPopup" TargetType="{x:Type controlzEx:PopupEx}">
<Setter Property="StaysOpen" Value="True" />
<Setter Property="AllowsTransparency" Value="True" />
<Setter Property="PopupAnimation" Value="None" />
<Setter Property="Placement" Value="Center" />
</Style>
<Style TargetType="{x:Type wpf:DialogHost}">
<Setter Property="DialogMargin" Value="35" />
<Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth5" />
<Setter Property="DialogTheme" Value="Light" />
<Setter Property="PopupStyle" Value="{StaticResource MaterialDesignDialogHostPopup}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="wpf:DialogHost">
<Grid x:Name="DialogHostRoot" Focusable="False">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="PopupStates">
<VisualStateGroup.Transitions>
<VisualTransition From="Closed" To="Open">
<Storyboard>
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="IsOpen">
<DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
</BooleanAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="0.56" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_PopupContentElement" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleX">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleY">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
<VisualTransition From="Open" To="Closed">
<Storyboard>
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="IsOpen">
<DiscreteBooleanKeyFrame Value="False" KeyTime="0:0:0.3" />
</BooleanAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="0.56" KeyTime="0" />
<EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_PopupContentElement" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="1" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.18" />
<EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleX">
<EasingDoubleKeyFrame Value="1" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.18" />
<EasingDoubleKeyFrame Value="0.5" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleY">
<EasingDoubleKeyFrame Value="1" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.18" />
<EasingDoubleKeyFrame Value="0.5" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Open">
<Storyboard>
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="IsOpen"
Duration="0">
<DiscreteBooleanKeyFrame Value="True" KeyTime="0" />
</BooleanAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity"
Duration="0"
To=".56" />
<DoubleAnimation Storyboard.TargetName="PART_PopupContentElement" Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
<DoubleAnimation Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleX"
Duration="0"
To="1" />
<DoubleAnimation Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleY"
Duration="0"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Closed">
<Storyboard>
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="IsOpen">
<DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
</BooleanAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity"
To="0" Duration="0"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<controlzEx:PopupEx PlacementTarget="{Binding ElementName=DialogHostRoot, Mode=OneWay}"
x:Name="PART_Popup"
Style="{TemplateBinding PopupStyle}"
wpf:ThemeAssist.Theme="{TemplateBinding DialogTheme}">
<wpf:Card x:Name="PART_PopupContentElement"
Margin="{TemplateBinding DialogMargin}"
wpf:ShadowAssist.ShadowDepth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ShadowAssist.ShadowDepth)}"
UniformCornerRadius="4"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
FocusManager.IsFocusScope="False"
Foreground="{DynamicResource MaterialDesignBody}"
FontFamily="{StaticResource MaterialDesignFont}"
Focusable="True"
IsTabStop="False"
Opacity="0"
RenderTransformOrigin=".5,.5"
Content="{TemplateBinding DialogContent}"
ContentTemplate="{TemplateBinding DialogContentTemplate}"
ContentTemplateSelector="{TemplateBinding DialogContentTemplateSelector}"
ContentStringFormat="{TemplateBinding DialogContentStringFormat}">
<wpf:Card.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="CardScaleTransform"
ScaleX="0"
ScaleY="0" />
</TransformGroup>
</wpf:Card.RenderTransform>
</wpf:Card>
</controlzEx:PopupEx>
<AdornerDecorator>
<ContentPresenter x:Name="ContentPresenter" Opacity="1" Content="{TemplateBinding ContentControl.Content}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
</AdornerDecorator>
<Grid x:Name="PART_ContentCoverGrid" Background="{Binding OverlayBackground, RelativeSource={RelativeSource TemplatedParent}}"
Opacity="0" IsHitTestVisible="False" Focusable="False">
<Grid.Style>
<Style TargetType="Grid">
<Style.Triggers>
<Trigger Property="Opacity" Value="0">
<Setter Property="Visibility" Value="Hidden" />
</Trigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsOpen" Value="True">
<Setter TargetName="ContentPresenter" Property="IsEnabled" Value="False" />
<Setter TargetName="PART_ContentCoverGrid" Property="IsHitTestVisible" Value="True" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MaterialDesignEmbeddedDialogHost" TargetType="{x:Type wpf:DialogHost}">
<Setter Property="DialogMargin" Value="35" />
<Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth5" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="wpf:DialogHost">
<Grid x:Name="DialogHostRoot" Focusable="False">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="PopupStates">
<VisualStateGroup.Transitions>
<VisualTransition From="Closed" To="Open">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" KeyTime="0" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="0.56" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_PopupContentElement" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleX">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleY">
<EasingDoubleKeyFrame Value="0" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
<VisualTransition From="Open" To="Closed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" KeyTime="0:0:0.3" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="0.56" KeyTime="0" />
<EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_PopupContentElement" Storyboard.TargetProperty="Opacity">
<EasingDoubleKeyFrame Value="1" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.18" />
<EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleX">
<EasingDoubleKeyFrame Value="1" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.18" />
<EasingDoubleKeyFrame Value="0.5" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleY">
<EasingDoubleKeyFrame Value="1" KeyTime="0" />
<EasingDoubleKeyFrame Value="1" KeyTime="0:0:0.18" />
<EasingDoubleKeyFrame Value="0.5" KeyTime="0:0:0.3">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseInOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Open">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="Visibility"
Duration="0">
<DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" KeyTime="0" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity"
Duration="0"
To=".56" />
<DoubleAnimation Storyboard.TargetName="PART_PopupContentElement" Storyboard.TargetProperty="Opacity"
Duration="0"
To="1" />
<DoubleAnimation Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleX"
Duration="0"
To="1" />
<DoubleAnimation Storyboard.TargetName="CardScaleTransform" Storyboard.TargetProperty="ScaleY"
Duration="0"
To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Closed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Popup" Storyboard.TargetProperty="Visibility"
Duration="0">
<DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" KeyTime="0" />
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="PART_ContentCoverGrid" Storyboard.TargetProperty="Opacity"
To="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter
x:Name="ContentPresenter" Opacity="1"
Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
<Grid x:Name="PART_ContentCoverGrid" Background="{Binding OverlayBackground, RelativeSource={RelativeSource TemplatedParent}}"
Opacity="0" IsHitTestVisible="False" Focusable="False">
<Grid.Style>
<Style TargetType="Grid">
<Style.Triggers>
<Trigger Property="Opacity" Value="0">
<Setter Property="Visibility" Value="Hidden" />
</Trigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
<Grid x:Name="PART_Popup" wpf:ThemeAssist.Theme="{TemplateBinding DialogTheme}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<wpf:Card
x:Name="PART_PopupContentElement"
Margin="{TemplateBinding DialogMargin}"
wpf:ShadowAssist.ShadowDepth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ShadowAssist.ShadowDepth)}"
UniformCornerRadius="4"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
FocusManager.IsFocusScope="False"
Foreground="{DynamicResource MaterialDesignBody}"
Focusable="True"
IsTabStop="False"
Opacity="0"
RenderTransformOrigin=".5,.5"
Content="{TemplateBinding DialogContent}"
ContentTemplate="{TemplateBinding DialogContentTemplate}"
ContentTemplateSelector="{TemplateBinding DialogContentTemplateSelector}"
ContentStringFormat="{TemplateBinding DialogContentStringFormat}">
<wpf:Card.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="CardScaleTransform"
ScaleX="0"
ScaleY="0" />
</TransformGroup>
</wpf:Card.RenderTransform>
</wpf:Card>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsOpen" Value="True">
<Setter TargetName="ContentPresenter" Property="IsEnabled" Value="False" />
<Setter TargetName="PART_ContentCoverGrid" Property="IsHitTestVisible" Value="True" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
You can’t perform that action at this time.