2025-10-17 14:18:01 +08:00

30 lines
1.5 KiB
XML

<UserControl x:Class="Wpf_AiSportsMicrospace.MyUserControl.BeatScrollDots"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf_AiSportsMicrospace.Converter"
mc:Ignorable="d"
Height="100" Width="400">
<UserControl.Resources>
<local:DotColorConverter x:Key="DotColorConverter"/>
</UserControl.Resources>
<ScrollViewer x:Name="scrollViewer" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled" Opacity="0.5">
<ItemsControl ItemsSource="{Binding Dots, ElementName=root}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Ellipse Width="20" Height="20"
Margin="{Binding ElementName=root, Path=DotSpacing}"
Fill="{Binding IsSelected, Converter={StaticResource DotColorConverter}}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</UserControl>