-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathSettingsExpanderSample.xaml
More file actions
49 lines (47 loc) · 2.85 KB
/
SettingsExpanderSample.xaml
File metadata and controls
49 lines (47 loc) · 2.85 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
<!-- 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. -->
<Page x:Class="SettingsControlsExperiment.Samples.SettingsExpanderSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:CommunityToolkit.WinUI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:CommunityToolkit.WinUI"
mc:Ignorable="d">
<local:SettingsExpander x:Name="settingsCard"
VerticalAlignment="Top"
Description="The SettingsExpander has the same properties as a Card, and you can set SettingsCard as part of the Items collection."
Header="SettingsExpander"
HeaderIcon="{ui:FontIcon Glyph=}"
IsEnabled="{x:Bind IsCardEnabled, Mode=OneWay}"
IsExpanded="{x:Bind IsCardExpanded, Mode=OneWay}">
<!-- TODO: This should be TwoWay bound but throws compile error in Uno. -->
<ComboBox SelectedIndex="0">
<ComboBoxItem>Option 1</ComboBoxItem>
<ComboBoxItem>Option 2</ComboBoxItem>
<ComboBoxItem>Option 3</ComboBoxItem>
</ComboBox>
<local:SettingsExpander.Items>
<local:SettingsCard Header="A basic SettingsCard within an SettingsExpander">
<Button Content="Button" />
</local:SettingsCard>
<local:SettingsCard Header="A ToggleSwitch attach TextBox">
<StackPanel Orientation="Horizontal">
<ToggleSwitch x:Name="toggleSwitch" />
<TextBox MinWidth="100"
Margin="30,5,0,5"
IsEnabled="{Binding IsOn, ElementName=toggleSwitch}"
PlaceholderText="TextBox" />
</StackPanel>
</local:SettingsCard>
<local:SettingsCard Description="SettingsCard within an Expander can be made clickable too!"
Header="This item can be clicked"
IsClickEnabled="True" />
<local:SettingsCard Description="You can override the Left indention of a SettingsCard by overriding the SettingsCardLeftIndention"
Header="Customization">
<local:SettingsCard.Resources>
<x:Double x:Key="SettingsCardLeftIndention">40</x:Double>
</local:SettingsCard.Resources>
</local:SettingsCard>
</local:SettingsExpander.Items>
</local:SettingsExpander>
</Page>