/
master_dialog_bare.xaml
109 lines (99 loc) · 5 KB
/
master_dialog_bare.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
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
<?xml version="1.0" encoding="utf-8"?>
<!--
This is the master template for a standard dialog.
Usage:
<Include
xmlns="www.team-mediaportal.com/2008/mpf/directx"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Source="screens\master_dialog_bare.xaml"
>
<Include.Resources>
<ResourceWrapper x:Key="Dialog_Header_Text">
[Header text to be shown as dialog title]
</ResourceWrapper>
<ControlTemplate x:Key="Contents_Template">
[Element which represents the contents area of the dialog.
Will be placed into a ScrollViewer.]
</ControlTemplate>
</Include.Resources>
</Include>
Parameters which have to be accessible by a DynamicResource lookup:
- Dialog_Header_Text (String): The text to be displayed as dialog title
- Contents_Template (ConrolTemplate): Template for the content area of the dialog.
-->
<Screen
xmlns="www.team-mediaportal.com/2008/mpf/directx"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="DialogScreen"
>
<Screen.Resources>
<Model x:Key="MouseModel" Id="CA6428A7-A6E2-4dd3-9661-F89CEBAF8E62"/>
</Screen.Resources>
<Screen.Triggers>
<EventTrigger RoutedEvent="Screen.Show">
<EventTrigger.Actions>
<BeginStoryboard Storyboard="{ThemeResource ShowDialogStoryboard}"/>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Screen.Hide">
<EventTrigger.Actions>
<BeginStoryboard Storyboard="{ThemeResource HideDialogStoryboard}"/>
</EventTrigger.Actions>
</EventTrigger>
</Screen.Triggers>
<DockPanel x:Name="ScreenAnimationElement" RenderTransformOrigin="0.5,0.5" Background="{ThemeResource DialogScreenBackgroundColor}"
LastChildFill="False">
<DockPanel.RenderTransform>
<TransformGroup>
<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1" ScaleY="1"/>
<SkewTransform CenterX="0.5" CenterY="0.5" AngleX="0" AngleY="0"/>
<RotateTransform CenterX="0.5" CenterY="0.5" Angle="0"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</DockPanel.RenderTransform>
<Border x:Name="DialogBorder" Margin="80" DockPanel.Dock="Center"
CornerRadius="{ThemeResource DialogBorderCornerRadius}"
VerticalAlignment="Center" HorizontalAlignment="Center">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="{ThemeResource DialogBackgroundGradient1Color}"/>
<GradientStop Color="{ThemeResource DialogBackgroundGradient2Color}" Offset="0.874"/>
</LinearGradientBrush>
</Border.Background>
<DockPanel x:Name="DialogBackgroundPanel" LastChildFill="True">
<Grid x:Name="DialogHeaderBackground" DockPanel.Dock="Top" Background="{ThemeResource DialogHeaderBackgroundBrush}"
VerticalAlignment="Top" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid x:Name="DialogHeaderGrid" Grid.Column="0" Grid.Row="0" Margin="5" HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label x:Name="DialogTitle" Grid.Column="0" Grid.Row="0" FontSize="{ThemeResource DialogTitleFontSize}" Margin="20,0,10,0"
Content="{Binding Source={DynamicResource Dialog_Header_Text},Path=Resource}" Color="{ThemeResource DialogHeaderColor}"
VerticalAlignment="Center" HorizontalAlignment="Left"
IsVisible="{Binding RelativeSource={RelativeSource Self},Path=Content,Converter={StaticResource ReferenceToBoolConverter}}"/>
<Control x:Name="AlternativeHeaderControl" Grid.Row="0" Grid.Column="0"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Template="{DynamicResource ResourceKey=Alternative_Contents_Template}"
IsVisible="{Binding RelativeSource={RelativeSource Self},Path=Template,Converter={StaticResource ReferenceToBoolConverter}}"/>
<Button x:Name="CloseButton" Grid.Column="1" Grid.Row="0" Style="{ThemeResource DialogCloseButtonStyle}" Margin="0,0,10,0"
Command="{Command Source={Service ScreenManager},Path=CloseTopmostDialog}"
IsVisible="{Binding Source={StaticResource MouseModel},Path=IsMouseUsed}" />
</Grid>
</Grid>
<Control x:Name="ContentPanel" Margin="10" DockPanel.Dock="Center"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Template="{DynamicResource ResourceKey=Contents_Template}"/>
</DockPanel>
</Border>
</DockPanel>
</Screen>