Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug title 轮播控件Carousel绑定数据时异常问题 #1680

Open
L-MAX6 opened this issue Dec 10, 2024 · 1 comment
Open

Bug title 轮播控件Carousel绑定数据时异常问题 #1680

L-MAX6 opened this issue Dec 10, 2024 · 1 comment

Comments

@L-MAX6
Copy link

L-MAX6 commented Dec 10, 2024

Describe the bug

首先,非常感谢你们的付出,控件很好用,谢谢。在使用中,我发现轮播控件Carousel绑定数据后不会自动更新,需要每次数据更新完毕后调用hcCarousel.OnApplyTemplate()才能更新,但还是有点问题,OnApplyTemplate()后第一张图片显示的宽度少于设定的宽度,要切换到第二张图片后才会恢复正常。如果直接在XAML中写死Image,宽度是正常的,看下图。期待你们的回复

Steps to reproduce the bug

XAML 代码 显示有问题,后面有截图:
`<hc:Carousel x:Name="hcCarousel" ItemsSource="{Binding ImageList}" Interval="0:0:5" IsCenter="True" AutoRun="True" Width="380" Height="400" VerticalAlignment="Center">
hc:Carousel.ItemTemplate

<hc:SimplePanel Width="380">


</hc:SimplePanel>

    </DataTemplate>
</hc:Carousel.ItemTemplate>

</hc:Carousel>ViewModel代码: View.hcCarousel.PageIndex = 0;
View.hcCarousel.OnApplyTemplate();`

Expected behavior

No response

Screenshots

errImage
trueImage

第一个图片就是OnApplyTemplate()后第一张图片显示
正常宽度是第二张图片

NuGet package version

None

IDE

Visual Studio 2022

Framework type

No response

Windows version

No response

Additional context

VS 2022 .NET 9.0 HandyControl 3.5.1

@L-MAX6
Copy link
Author

L-MAX6 commented Dec 10, 2024

微信截图_20241210175737

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant