Semi.Avalonia/demo/Semi.Avalonia.Demo/Pages/ScrollViewerDemo.axaml
2023-07-11 17:40:57 +08:00

75 lines
3.0 KiB
XML

<UserControl
x:Class="Semi.Avalonia.Demo.Pages.ScrollViewerDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20">
<ScrollViewer
Width="200"
Height="200"
Margin="10"
HorizontalScrollBarVisibility="Auto">
<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>
<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>