Closed kaismic closed 2 hours ago
I think this might need an issue with how the property ImageInfo
is defined in your UserControl ImageCollectionPanel
. Can you try implementing it as a DependencyProperty and use BindingMode.OneWay inside ImageCollectionPanel.xaml
and see if it still repros?
I think this might need an issue with how the property
ImageInfo
is defined in your UserControlImageCollectionPanel
. Can you try implementing it as a DependencyProperty and use BindingMode.OneWay insideImageCollectionPanel.xaml
and see if it still repros?
Yep, it worked. Thank you very much!
ImageCollectionPanel.xaml
<Grid>
<Image>
<Image.Source>
<BitmapImage UriSource="{x:Bind ImageInfo.ImageFilePath, Mode=OneWay}"/>
</Image.Source>
</Image>
</Grid>
ImageCollectionPanel.xaml.cs
public sealed partial class ImageCollectionPanel : Grid {
public static readonly DependencyProperty ImageInfoProperty = DependencyProperty.Register(
nameof(ImageInfo),
typeof(ImageInfo),
typeof(ImageCollectionPanel),
null
);
public ImageInfo ImageInfo {
get => (ImageInfo)GetValue(ImageInfoProperty);
set => SetValue(ImageInfoProperty, value);
}
//public ImageInfo ImageInfo { get; set; }
public ImageCollectionPanel() {
InitializeComponent();
}
}
Describe the bug
When
FlipView.ItemTemplate
contains a custom view class which is derived from aFrameworkElement
, theFlipView
only displays the first 4 items and loops through them.Sometimes even the same image appears twice in a row when scrolling back.
Specifically:
ImageCollectionPanel.xaml
This works fine:
But this does not:
Steps to reproduce the bug
images
folder toC:\%USERPROFILE%\AppData\Local\Packages\ce327634-4e8f-4be9-ada0-51371298762e_90dh4avacgaqr\LocalCache\Local
.Expected behavior
FlipView
should show all the images as I flip through the pages.Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002
Windows version
Windows 10 (20H2): Build 19042
Additional context
it probably won't matter but: My
.csproj
contains