fix: fix carousel collection conversion.
This commit is contained in:
parent
3473c754a2
commit
33db3bf0d4
@ -141,8 +141,8 @@
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
ItemContainerTheme="{DynamicResource CarouselIndicatorDotListBoxItem}"
|
||||
Items="{TemplateBinding Items,
|
||||
Converter={StaticResource ItemsConverter}}"
|
||||
ItemsSource="{TemplateBinding Items,
|
||||
Converter={StaticResource ItemsConverter}}"
|
||||
SelectedIndex="{Binding SelectedIndex, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Avalonia.Collections;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data.Converters;
|
||||
|
||||
namespace Semi.Avalonia.Converters;
|
||||
@ -11,7 +12,7 @@ public class ItemToObjectConverter: IValueConverter
|
||||
{
|
||||
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is AvaloniaList<object> list)
|
||||
if (value is ItemCollection list)
|
||||
{
|
||||
return list.Select(a => new object());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user