forked from CommunityToolkit/Tooling-Windows-Submodule
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectTemplateStyle_xBind.xaml
More file actions
69 lines (62 loc) · 3.59 KB
/
ProjectTemplateStyle_xBind.xaml
File metadata and controls
69 lines (62 loc) · 3.59 KB
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
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<ResourceDictionary x:Class="CommunityToolkit.WinUI.Controls.ProjectTemplateStyle_xBind"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.Controls">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="MyBrush"
Color="#000000" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="MyBrush"
Color="{StaticResource SystemBaseMediumColor}" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="MyBrush"
Color="{ThemeResource SystemColorButtonFaceColor}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<Thickness x:Key="DefaultProjectTemplateItemPadding">4,4,4,4</Thickness>
<!-- Implicitly applied default style -->
<Style BasedOn="{StaticResource DefaultxBindProjectTemplateStyle}"
TargetType="controls:ProjectTemplate_xBind" />
<Style x:Key="DefaultxBindProjectTemplateStyle"
TargetType="controls:ProjectTemplate_xBind">
<Style.Setters>
<Setter Property="MyProperty" Value="This property has been overriden by the style template" />
<Setter Property="ItemPadding" Value="{StaticResource DefaultProjectTemplateItemPadding}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:ProjectTemplate_xBind">
<ContentPresenter x:Name="ContentContainer"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch">
<ContentPresenter.ContentTemplate>
<DataTemplate x:DataType="controls:ProjectTemplate_xBind">
<Grid Padding="{x:Bind ItemPadding}"
PointerEntered="{x:Bind Element_PointerEntered}">
<StackPanel Spacing="20">
<TextBlock Foreground="{ThemeResource MyBrush}"
Text="Hello world!" />
<TextBlock Text="{x:Bind MyProperty, Mode=OneWay}" />
</StackPanel>
</Grid>
</DataTemplate>
</ContentPresenter.ContentTemplate>
</ContentPresenter>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>
<!-- Minimal, custom style -->
<Style x:Key="CustomxBindProjectTemplateStyle"
BasedOn="{StaticResource DefaultxBindProjectTemplateStyle}"
TargetType="controls:ProjectTemplate_xBind">
<Style.Setters>
<Setter Property="MyProperty" Value="This property has been overriden by a custom style!" />
<Setter Property="ItemPadding" Value="25" />
</Style.Setters>
</Style>
</ResourceDictionary>