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
Many ImageEx controls causing Windows.UI.Xaml.LayoutCycleException #1328
Comments
ListView will use virtualization on the item container ( cc @hermitdave . |
@Code-ScottLe @hermitdave @darshanrampatel My stack overflow app loads around 30 users per page and it has no issue. Maybe it is something related to number of ListViewItems? Can you try decreasing the loading count and see if it still crashes? |
Can you post a repro? |
Will try and get a repro together this weekend.
|
@hermitdave @Code-ScottLe @avknaidu If you uncomment one of the below
|
Few things, your project above doesn't have enough stuffs (missing base Microsoft.Toolkit.Uwp and Microsoft.Toolkit.Uwp.UI). |
@darshanrampatel how did you add a reference to the controls lib? Nuget is good because it automatically downloads dependencies |
@Code-ScottLe Can you try this with the app maximised please?
|
@hermitdave I did use NuGet... Though I think I added the controls library only, not the main toolkit one.
I have fixed this now.
|
I only minimized this so I can show you how long it was running. Showing no problem at all. |
@Code-ScottLe Hmm, I always get a crash instantly. See this video: ImageExIssue.zip |
I can't playback your video for some reason. Make sure you have all of the packages. Even the Animation one. Some of the controls does use some of the animations from our own toolkit. |
I'll take a look in a few minutes |
I can't seem to reproduce the issue. I can maximize and restore back to original size without any issues. |
@darshanrampatel can you please try and run the sample app (download from store) and see if you have the same issue ? |
@hermitdave I can run the store app with no issue. I am also using ImageEx in my apps extensively and, just so it's clear, this is only an issue when many Just to confirm, I am maximising the repro app before I press the refresh button so that the maximum number of I have tested this and I can load 120 How many |
@darshanrampatel my daily mail online app has around 400 imageex controls on channel pages. I have a simplified template to not include progress ring. |
@hermitdave Interesting. If I adjust the template to not include the progress ring in the repro app, I don't get any exceptions and can load 200+ controls at once. |
So if you don't have the progress ring, you can load more stuffs? That is a little bit odd. |
@darshanrampatel progress ring itself has tons of animations and lots of those would imply UI thread load. |
@Code-ScottLe not really.. Less stress on UI thread.. |
@hermitdave But shouldn't the ListView would just virtualize the entire list? Unless all 200+ items are tiny enough to be displayed all at once. |
@Code-ScottLe in this instance its a grid view and default virtualization would be 4 pages + current which mean lots of images in this instance.. 128x128 |
@hermitdave I guess that could reduce the amount of time spending on the UI thread for optimization purpose. Not sure how that is breaking @darshanrampatel in this case with the exception though. @darshanrampatel can you try your project with reference to the actual toolkit project? It might help you debug this further. |
@Code-ScottLe @hermitdave I was playing around with the All I did was add the
I can't see any downsides to doing this. Can you guys please test this? I have update the repro project with this new style.
|
I have a project wherein I use an ImageEx control inside an item template and when this template is used in a FlipView with many ImageEx controls on a page, they never load when IsCacheEnabled="True". Removing this makes them work again, but this was one of the reasons I wanted to use ImageEx. Boo. I tried the style template above, hoping it might fix the issue but of course it did not. Oh, yes, before you ask, I did enable the cache. :) |
@Swifter could you please post a repro ? |
@hermitdave This is a HUGE project, but I will try to make a little one for you. |
@Swifter I use ImageEx controls within a FlipView as well and have no issues with the IsCacheEnabled property. My
|
This issue seems inactive. It will automatically be closed in 14 days if there is no activity. |
This issue seems inactive. It will automatically be closed in 7 days if there is no activity. |
@hermitdave @Code-ScottLe Do you want to make a PR to adjust the template to add the |
I'll have a go when i get back to UK.. Getting little computer time while on holiday |
Setting Visibility of ProgressRing to Collapsed by default. Modify VisualState to make ProgressRing Visible when Loading. Removed un-necessary modification in Loaded state.
PR merged |
I have a ListView (containing around ~180 items) where the DataTemplate contains an ImageEx control:
If I try and load these all at once, I get one of the below exceptions:
Changing the
ImageEx
control to a standardImage
control doesn't cause this exception:Is there anything I can do to work around this apart from switching back to the
Image
control?The text was updated successfully, but these errors were encountered: