feat: fix demo name. add a failing case.

This commit is contained in:
Dong Bin
2025-02-25 01:05:06 +08:00
parent d4b990899d
commit 862d4157d2
2 changed files with 7 additions and 3 deletions

View File

@@ -0,0 +1,59 @@
<UserControl
x:Class="Ursa.Demo.Pages.SelectionListDemo"
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"
xmlns:u="https://irihi.tech/ursa"
xmlns:vm="using:Ursa.Demo.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="vm:SelectionListDemoViewModel"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left">
<u:SelectionList
Width="600"
HorizontalAlignment="Center"
ItemsSource="{Binding Items}"
SelectedItem="{Binding SelectedItem}">
<u:SelectionList.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" />
</ItemsPanelTemplate>
</u:SelectionList.ItemsPanel>
</u:SelectionList>
<u:SelectionList ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" />
<u:SelectionList ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<u:SelectionList.Indicator>
<Border Background="Transparent" CornerRadius="4">
<Border
Width="4"
Margin="0,8"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Background="{DynamicResource SemiBlue6}"
CornerRadius="4" />
</Border>
</u:SelectionList.Indicator>
<u:SelectionList.ItemTemplate>
<DataTemplate>
<Panel Height="40">
<TextBlock
Margin="8,0"
VerticalAlignment="Center"
Classes.Active="{Binding $parent[u:SelectionListItem].IsSelected, Mode=OneWay}"
Text="{Binding}">
<TextBlock.Styles>
<Style Selector="TextBlock.Active">
<Setter Property="Foreground" Value="{DynamicResource SemiOrange6}" />
</Style>
</TextBlock.Styles>
</TextBlock>
</Panel>
</DataTemplate>
</u:SelectionList.ItemTemplate>
</u:SelectionList>
<Button Command="{Binding Clear}">Clear</Button>
</StackPanel>
</UserControl>