feat: add new StyleClass to ScrollViewer: InsetContent

This commit is contained in:
Dong Bin
2025-03-13 11:15:50 +08:00
parent d03e80d0ef
commit 9aa24c066b
2 changed files with 9 additions and 32 deletions

View File

@@ -9,9 +9,13 @@
mc:Ignorable="d">
<ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20">
<ToggleSwitch Name="inset" Content="Inset Content"></ToggleSwitch>
<ToggleSwitch Name="autohide" Content="Allow AutoHide"></ToggleSwitch>
<ScrollViewer
Width="200"
Height="200"
AllowAutoHide="{Binding #autohide.IsChecked}"
Classes.InsetContent="{Binding #inset.IsChecked}"
Margin="10"
HorizontalScrollBarVisibility="Auto">
<Grid RowDefinitions="Auto,Auto"
@@ -39,37 +43,6 @@
Fill="{DynamicResource SemiGreen2}" />
</Grid>
</ScrollViewer>
<ScrollViewer
Width="200"
Height="200"
Margin="10"
HorizontalScrollBarVisibility="Auto"
Theme="{DynamicResource StaticScrollViewer}">
<Grid RowDefinitions="Auto,Auto"
ColumnDefinitions="Auto,Auto"
Width="300" Height="300">
<Rectangle
Grid.Row="0" Grid.Column="0"
Width="150"
Height="150"
Fill="{DynamicResource SemiYellow2}" />
<Rectangle
Grid.Row="0" Grid.Column="1"
Width="150"
Height="150"
Fill="{DynamicResource SemiBlue2}" />
<Rectangle
Grid.Row="1" Grid.Column="0"
Width="150"
Height="150"
Fill="{DynamicResource SemiPink2}" />
<Rectangle
Grid.Row="1" Grid.Column="1"
Width="150"
Height="150"
Fill="{DynamicResource SemiGreen2}" />
</Grid>
</ScrollViewer>
</StackPanel>
</ScrollViewer>
</UserControl>