-
-
Notifications
You must be signed in to change notification settings - Fork 492
/
Copy pathPatternBackground.xaml
149 lines (139 loc) · 8.19 KB
/
PatternBackground.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Telegram.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Style x:Key="ProfileHeaderPatternStyle"
TargetType="controls:ProfileHeaderPattern">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:ProfileHeaderPattern">
<Grid Width="1000"
Height="320">
<Border x:Name="LayoutRoot" />
<controls:AnimatedImage x:Name="Animated"
FrameSize="36,36"
DecodeFrameType="Logical"
AutoPlay="False"
IsViewportAware="False"
ReplacementColor="{TemplateBinding Foreground}"
Source="{TemplateBinding Source}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="36"
Height="36"
Opacity="0"
IsTabStop="False" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="controls:PatternBackground">
<!--<Setter Property="BorderBrush"
Value="{ThemeResource CardStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness"
Value="0,1" />-->
<Setter Property="BackgroundSizing"
Value="OuterBorderEdge" />
<Setter Property="HorizontalContentAlignment"
Value="Stretch" />
<Setter Property="VerticalContentAlignment"
Value="Stretch" />
<Setter Property="Padding"
Value="0,16,0,16" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:PatternBackground">
<Grid x:Name="HeaderRoot"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Padding="{TemplateBinding Padding}">
<Grid.BackgroundTransition>
<BrushTransition />
</Grid.BackgroundTransition>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="140"
Height="140"
Margin="-70,0,-70,-12">
<Border x:Name="HeaderGlow"
Width="1000"
Height="320"
Margin="-430,0,-430,-156"
RenderTransformOrigin="0.5,0.0">
<Border.RenderTransform>
<ScaleTransform ScaleX="{Binding ScaleXY, RelativeSource={RelativeSource Mode=TemplatedParent}}"
ScaleY="{Binding ScaleXY, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</Border.RenderTransform>
</Border>
<controls:ProfileHeaderPattern x:Name="Pattern"
IsSmall="True"
Margin="-430,0,-430,-156"
Width="1000"
Height="320"
Opacity="0"
Style="{StaticResource ProfileHeaderPatternStyle}" />
<ContentPresenter Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Width="120"
Height="120"
VerticalAlignment="Bottom" />
</Grid>
<ContentControl Content="{TemplateBinding Footer}"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Grid.Row="1" />
<!--<Border VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Grid.Row="1">
<Grid x:Name="LabelTitle">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<controls:CustomEmojiIcon x:Name="BotVerified"
VerticalAlignment="Bottom"
Margin="0,0,4,4" />
<TextBlock x:Name="Title"
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis"
TextAlignment="Center"
IsTextSelectionEnabled="True"
Style="{StaticResource SubtitleTextBlockStyle}"
FontFamily="{ThemeResource EmojiThemeFontFamily}"
Grid.Column="1" />
<controls:IdentityIcon x:Name="Identity"
VerticalAlignment="Bottom"
Margin="4,0,0,4"
Grid.Column="2" />
</Grid>
</Border>
<Border VerticalAlignment="Top"
Margin="0,-2,0,0"
Grid.Row="2">
<TextBlock x:Name="Subtitle"
Style="{StaticResource BodyTextBlockStyle}"
Foreground="{ThemeResource PageHeaderDisabledBrush}"
TextAlignment="Center" />
</Border>-->
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>