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