|
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 | 6 | xmlns:labs="using:CommunityToolkit.Labs.WinUI" |
7 | 7 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 8 | + xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
8 | 9 | mc:Ignorable="d"> |
9 | 10 | <Page.Resources> |
10 | 11 | <!-- These styles can be referenced to create a consistent SettingsPage layout --> |
| 12 | + |
| 13 | + <!-- Spacing between cards --> |
11 | 14 | <x:Double x:Key="SettingsCardSpacing">3</x:Double> |
12 | | - <Style x:Key="SettingsGroupTextBlockStyle" |
| 15 | + |
| 16 | + <!-- Style (inc. the correct spacing) of a section header --> |
| 17 | + <Style x:Key="SettingsSectionHeaderTextBlockStyle" |
13 | 18 | BasedOn="{StaticResource BodyStrongTextBlockStyle}" |
14 | 19 | TargetType="TextBlock"> |
15 | 20 | <Style.Setters> |
16 | | - <Setter Property="Margin" Value="1,30,0,4" /> |
| 21 | + <Setter Property="Margin" Value="1,29,0,5" /> |
17 | 22 | </Style.Setters> |
18 | 23 | </Style> |
19 | 24 | </Page.Resources> |
20 | 25 | <ScrollViewer> |
21 | 26 | <StackPanel MaxWidth="1000" |
22 | 27 | HorizontalAlignment="Stretch" |
23 | 28 | Spacing="{StaticResource SettingsCardSpacing}"> |
24 | | - <!-- TODO: @Niels - I just copied everything here, not sure if any values need adjusting. We should probably use this as a place to have more bespoke examples of each type of content like Slider, ComboBox, TextBox, etc... --> |
25 | | - <TextBlock Style="{StaticResource SettingsGroupTextBlockStyle}" |
26 | | - Text="Group of settings" /> |
27 | | - <labs:SettingsCard Description="This is a default card, with the Header, HeaderIcon, Description and Content set." |
| 29 | + <win:StackPanel.ChildrenTransitions> |
| 30 | + <win:EntranceThemeTransition FromVerticalOffset="50" /> |
| 31 | + <win:RepositionThemeTransition IsStaggeringEnabled="False" /> |
| 32 | + </win:StackPanel.ChildrenTransitions> |
| 33 | + <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" |
| 34 | + Text="Section 1" /> |
| 35 | + <labs:SettingsCard Description="This is a default card, with the Header, HeaderIcon, Description and Content set" |
28 | 36 | Header="This is the Header"> |
29 | 37 | <labs:SettingsCard.HeaderIcon> |
30 | | - <FontIcon Glyph="" /> |
| 38 | + <FontIcon Glyph="" /> |
31 | 39 | </labs:SettingsCard.HeaderIcon> |
32 | | - <ComboBox SelectedIndex="0"> |
33 | | - <ComboBoxItem>Option 1</ComboBoxItem> |
34 | | - <ComboBoxItem>Option 2</ComboBoxItem> |
35 | | - <ComboBoxItem>Option 3</ComboBoxItem> |
36 | | - </ComboBox> |
| 40 | + <ToggleSwitch IsOn="True" /> |
37 | 41 | </labs:SettingsCard> |
38 | 42 |
|
39 | | - <labs:SettingsCard Description="You can use a FontIcon, SymbolIcon or BitmapIcon to set the cards HeaderIcon." |
40 | | - Header="Icon options"> |
41 | | - <labs:SettingsCard.HeaderIcon> |
42 | | - <BitmapIcon ShowAsMonochrome="False" |
43 | | - UriSource="https://raw.githubusercontent.com/microsoft/PowerToys/main/src/settings-ui/Settings.UI/Assets/FluentIcons/FluentIconsImageResizer.png" /> |
44 | | - </labs:SettingsCard.HeaderIcon> |
45 | | - <ToggleSwitch /> |
46 | | - </labs:SettingsCard> |
47 | | - |
48 | | - <labs:SettingsCard Header="A card with custom objects as its Description"> |
49 | | - <labs:SettingsCard.Description> |
50 | | - <HyperlinkButton Content="Learn more about Phone Link" /> |
51 | | - </labs:SettingsCard.Description> |
52 | | - <Button Content="Open Phone Link" |
| 43 | + <labs:SettingsExpander Description="The SettingsExpander has the same properties as a SettingsCard" |
| 44 | + Header="SettingsExpander"> |
| 45 | + <labs:SettingsExpander.HeaderIcon> |
| 46 | + <FontIcon Glyph="" /> |
| 47 | + </labs:SettingsExpander.HeaderIcon> |
| 48 | + <Button Content="Content" |
53 | 49 | Style="{StaticResource AccentButtonStyle}" /> |
54 | | - </labs:SettingsCard> |
55 | 50 |
|
56 | | - <labs:SettingsCard Description="When resizing a SettingsCard, the Content will wrap vertically. You can override this breakpoint by setting the SettingsCardWrapThreshold resource." |
57 | | - Header="Adaptive layouts"> |
58 | | - <labs:SettingsCard.HeaderIcon> |
59 | | - <FontIcon Glyph="" /> |
60 | | - </labs:SettingsCard.HeaderIcon> |
61 | | - <labs:SettingsCard.Resources> |
62 | | - <x:Double x:Key="SettingsCardWrapThreshold">800</x:Double> |
63 | | - </labs:SettingsCard.Resources> |
64 | | - <Button Content="This control will wrap vertically!" |
65 | | - Style="{StaticResource AccentButtonStyle}" /> |
66 | | - </labs:SettingsCard> |
| 51 | + <labs:SettingsExpander.Items> |
| 52 | + <labs:SettingsCard Header="A basic SettingsCard within an SettingsExpander"> |
| 53 | + <Button Content="Button" /> |
| 54 | + </labs:SettingsCard> |
| 55 | + <labs:SettingsCard Description="SettingsCard within an Expander can be made clickable too!" |
| 56 | + Header="This item can be clicked" |
| 57 | + IsClickEnabled="True" /> |
67 | 58 |
|
68 | | - <TextBlock Style="{StaticResource SettingsGroupTextBlockStyle}" |
69 | | - Text="Next group of settings" /> |
| 59 | + <labs:SettingsCard ContentAlignment="Left"> |
| 60 | + <CheckBox Content="Here the ContentAlignment is set to Left. This is great for e.g. CheckBoxes or RadioButtons" /> |
| 61 | + </labs:SettingsCard> |
| 62 | + </labs:SettingsExpander.Items> |
| 63 | + </labs:SettingsExpander> |
70 | 64 |
|
71 | | - <labs:SettingsCard Description="A SettingsCard can be made clickable and you can leverage the Command property or Click event." |
72 | | - Header="A clickable SettingsCard" |
73 | | - IsClickEnabled="True"> |
| 65 | + <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" |
| 66 | + Text="Section 2" /> |
| 67 | + <labs:SettingsCard Description="Another card to show grouping of cards" |
| 68 | + Header="Another SettingsCard"> |
74 | 69 | <labs:SettingsCard.HeaderIcon> |
75 | 70 | <FontIcon Glyph="" /> |
76 | 71 | </labs:SettingsCard.HeaderIcon> |
| 72 | + <ComboBox SelectedIndex="0"> |
| 73 | + <ComboBoxItem>Option 1</ComboBoxItem> |
| 74 | + <ComboBoxItem>Option 2</ComboBoxItem> |
| 75 | + <ComboBoxItem>Option 3</ComboBoxItem> |
| 76 | + </ComboBox> |
77 | 77 | </labs:SettingsCard> |
78 | 78 |
|
79 | | - <labs:SettingsCard ActionIconToolTip="Open in new window" |
80 | | - Description="You can customize the ActionIcon and ActionIconToolTip." |
81 | | - Header="Customizing the ActionIcon" |
82 | | - IsClickEnabled="True"> |
| 79 | + <labs:SettingsCard Description="Another card to show grouping of cards" |
| 80 | + Header="Yet another SettingsCard"> |
83 | 81 | <labs:SettingsCard.HeaderIcon> |
84 | | - <FontIcon Glyph="" /> |
| 82 | + <FontIcon Glyph="" /> |
85 | 83 | </labs:SettingsCard.HeaderIcon> |
86 | | - <labs:SettingsCard.ActionIcon> |
87 | | - <FontIcon FontSize="12" |
88 | | - Glyph="" /> |
89 | | - </labs:SettingsCard.ActionIcon> |
| 84 | + <Button Content="Content" /> |
90 | 85 | </labs:SettingsCard> |
91 | 86 |
|
92 | | - <TextBlock Style="{StaticResource SettingsGroupTextBlockStyle}" |
93 | | - Text="Final group of settings" /> |
| 87 | + <!-- Example 'About' section --> |
| 88 | + <TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" |
| 89 | + Text="About" /> |
94 | 90 |
|
95 | | - <labs:SettingsExpander Description="The SettingsExpander has the same properties as a Card, and you can set SettingsCard as part of the Items collection." |
96 | | - Header="SettingsExpander"> |
| 91 | + <labs:SettingsExpander Description="© 2023. All rights reserved." |
| 92 | + Header="Community Toolkit Gallery"> |
97 | 93 | <labs:SettingsExpander.HeaderIcon> |
98 | | - <FontIcon Glyph="" /> |
| 94 | + <BitmapIcon ShowAsMonochrome="False" |
| 95 | + UriSource="ms-appx:///Assets/AppTitleBar.scale-200.png" /> |
99 | 96 | </labs:SettingsExpander.HeaderIcon> |
100 | | - <ComboBox SelectedIndex="0"> |
101 | | - <ComboBoxItem>Option 1</ComboBoxItem> |
102 | | - <ComboBoxItem>Option 2</ComboBoxItem> |
103 | | - <ComboBoxItem>Option 3</ComboBoxItem> |
104 | | - </ComboBox> |
105 | | - |
| 97 | + <TextBlock win:IsTextSelectionEnabled="True" |
| 98 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
| 99 | + Style="{StaticResource CaptionTextBlockStyle}" |
| 100 | + Text="Version 1.0.0.0" /> |
106 | 101 | <labs:SettingsExpander.Items> |
107 | | - <labs:SettingsCard Header="A basic SettingsCard within an SettingsExpander"> |
108 | | - <Button Content="Button" /> |
109 | | - </labs:SettingsCard> |
110 | | - <labs:SettingsCard Description="SettingsCard within an Expander can be made clickable too!" |
111 | | - Header="This item can be clicked" |
112 | | - IsClickEnabled="True" /> |
113 | | - |
114 | | - <labs:SettingsCard ContentAlignment="Left"> |
115 | | - <CheckBox Content="Here the ContentAlignment is set to Left. This is great for e.g. CheckBoxes or RadioButtons." /> |
116 | | - </labs:SettingsCard> |
117 | | - |
118 | 102 | <labs:SettingsCard HorizontalContentAlignment="Left" |
119 | | - ContentAlignment="Vertical" |
120 | | - Description="You can also align your content vertically. Make sure to set the HorizontalAlignment to Left when you do!" |
121 | | - Header="Vertically aligned"> |
122 | | - <GridView SelectedIndex="1"> |
123 | | - <GridViewItem> |
124 | | - <Border Width="64" |
125 | | - Height="64" |
126 | | - Background="#0078D4" |
127 | | - CornerRadius="4" /> |
128 | | - </GridViewItem> |
129 | | - <GridViewItem> |
130 | | - <Border Width="64" |
131 | | - Height="64" |
132 | | - Background="#005EB7" |
133 | | - CornerRadius="4" /> |
134 | | - </GridViewItem> |
135 | | - <GridViewItem> |
136 | | - <Border Width="64" |
137 | | - Height="64" |
138 | | - Background="#003D92" |
139 | | - CornerRadius="4" /> |
140 | | - </GridViewItem> |
141 | | - <GridViewItem> |
142 | | - <Border Width="64" |
143 | | - Height="64" |
144 | | - Background="#001968" |
145 | | - CornerRadius="4" /> |
146 | | - </GridViewItem> |
147 | | - </GridView> |
148 | | - </labs:SettingsCard> |
149 | | - <labs:SettingsCard Description="You can override the Left indention of a SettingsCard by overriding the SettingsCardLeftIndention" |
150 | | - Header="Customization"> |
151 | | - <labs:SettingsCard.Resources> |
152 | | - <x:Double x:Key="SettingsCardLeftIndention">40</x:Double> |
153 | | - </labs:SettingsCard.Resources> |
| 103 | + ContentAlignment="Left"> |
| 104 | + <StackPanel Margin="-12,0,0,0" |
| 105 | + Orientation="Vertical"> |
| 106 | + <HyperlinkButton Content="Link 1" /> |
| 107 | + <HyperlinkButton Content="Link 2" /> |
| 108 | + <HyperlinkButton Content="Link 3" /> |
| 109 | + </StackPanel> |
154 | 110 | </labs:SettingsCard> |
155 | 111 | </labs:SettingsExpander.Items> |
156 | 112 | </labs:SettingsExpander> |
| 113 | + <HyperlinkButton Margin="0,8,0,0" |
| 114 | + Content="Send feedback" /> |
157 | 115 | </StackPanel> |
158 | 116 | </ScrollViewer> |
159 | 117 | </Page> |
0 commit comments