Bug title 轮播控件Carousel绑定数据时异常问题
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 28/100
Research direction
Start by reproducing the Carousel behavior with the XAML and ViewModel code shown in the issue, focusing on ItemsSource updates and the first-image width after OnApplyTemplate(). Trace the Carousel control's data-refresh and template-layout behavior. Done means bound data updates automatically and the first image has the configured width without requiring a page switch.
Written by the indexing model from the issue text.
Description
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
第一个图片就是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
- Dominant language
- C#
- Stars
- 7.2k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HandyOrg/HandyControl
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
HandyOrg/HandyControl#1818 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
HandyOrg/HandyControl#1809 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
HandyOrg/HandyControl#1820 ·
-
不能够独立的引入用户认为需要的部分Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
HandyOrg/HandyControl#1816 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
HandyOrg/HandyControl#1813 ·
All issues in HandyOrg/HandyControl
Similar issues
-
copilot documentation
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
[Rust][Flaky Test] multiple_deadlines_fire_in_order asserts a wall-clock gap instead of firing orderOpenCI/CD ⚒️ Flaky-tests 🐦
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
valkey-io/valkey-glide#7255 ·
Maintainers usually reply within 3 days
-
bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 92/100
unoplatform/Uno.Core#99 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
aws/aws-dotnet-ai#75 ·