|
1 | 1 | <Page x:Class="SettingsControlsExperiment.Samples.SettingsExpanderDragHandleSample" |
2 | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" |
4 | 5 | xmlns:controls="using:CommunityToolkit.WinUI.Controls" |
5 | 6 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
6 | 7 | xmlns:local="using:SettingsControlsExperiment.Samples" |
|
23 | 24 | <ColumnDefinition Width="Auto" /> |
24 | 25 | <ColumnDefinition Width="*" /> |
25 | 26 | </Grid.ColumnDefinitions> |
26 | | - <!-- Provide a custom area that can be manipulated by the user --> |
27 | | - <!-- TODO: Show how to highlight this on hover with a behavior --> |
28 | | - <Border Width="18" |
29 | | - Margin="1,1,0,1" |
30 | | - Padding="0" |
31 | | - VerticalAlignment="Stretch" |
32 | | - Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" |
| 27 | + <!-- Provide a custom area that can be manipulated by the user, this could be before or after the card. --> |
| 28 | + <Border Width="36" |
| 29 | + Height="75" |
| 30 | + Margin="1,1,1,1" |
| 31 | + VerticalAlignment="Top" |
| 32 | + Background="Transparent" |
33 | 33 | CornerRadius="{ThemeResource ControlCornerRadius}"> |
34 | 34 | <TextBlock HorizontalAlignment="Center" |
35 | 35 | VerticalAlignment="Center" |
36 | 36 | FontFamily="Segoe UI Symbol" |
37 | | - FontSize="16" |
| 37 | + FontSize="20" |
38 | 38 | Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
39 | | - Opacity="0.5" |
40 | 39 | Text="⠿" /> |
| 40 | + <!-- Use Behaviors to hover on pointer --> |
| 41 | + <Interactivity:Interaction.Behaviors> |
| 42 | + <Interactivity:EventTriggerBehavior EventName="PointerEntered"> |
| 43 | + <Interactivity:ChangePropertyAction PropertyName="Background"> |
| 44 | + <Interactivity:ChangePropertyAction.Value> |
| 45 | + <SolidColorBrush Color="{ThemeResource ControlFillColorDefault}" /> |
| 46 | + </Interactivity:ChangePropertyAction.Value> |
| 47 | + </Interactivity:ChangePropertyAction> |
| 48 | + </Interactivity:EventTriggerBehavior> |
| 49 | + <Interactivity:EventTriggerBehavior EventName="PointerExited"> |
| 50 | + <Interactivity:ChangePropertyAction PropertyName="Background"> |
| 51 | + <Interactivity:ChangePropertyAction.Value> |
| 52 | + <SolidColorBrush Color="Transparent" /> |
| 53 | + </Interactivity:ChangePropertyAction.Value> |
| 54 | + </Interactivity:ChangePropertyAction> |
| 55 | + </Interactivity:EventTriggerBehavior> |
| 56 | + </Interactivity:Interaction.Behaviors> |
41 | 57 | </Border> |
| 58 | + <!-- Standard Settings Expander (could also just be a Card) --> |
42 | 59 | <controls:SettingsExpander Grid.Column="1" |
43 | 60 | Description="{x:Bind Info}" |
44 | | - Header="{x:Bind Name}"> |
| 61 | + Header="{x:Bind Name}" |
| 62 | + IsExpanded="{x:Bind IsExpanded, Mode=TwoWay}"> |
45 | 63 |
|
46 | 64 | <ToggleSwitch OffContent="Off" |
47 | | - OnContent="On" /> |
| 65 | + OnContent="On" |
| 66 | + IsOn="{x:Bind IsExpanded, Mode=TwoWay}"/> |
48 | 67 |
|
49 | 68 | <controls:SettingsExpander.Items> |
50 | 69 | <controls:SettingsCard Header="{x:Bind LinkDescription}"> |
|
56 | 75 | </Grid> |
57 | 76 | </DataTemplate> |
58 | 77 | </ListView.ItemTemplate> |
| 78 | + <!-- Customize Size of Item Container from ListView --> |
59 | 79 | <ListView.ItemContainerStyle> |
60 | 80 | <Style BasedOn="{StaticResource DefaultListViewItemStyle}" |
61 | 81 | TargetType="ListViewItem"> |
|
0 commit comments