Skip to content

TileControl crash when Resolution Changes #3629

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

Closed
1 task done
hawkerm opened this issue Dec 15, 2020 · 1 comment · Fixed by #3808
Closed
1 task done

TileControl crash when Resolution Changes #3629

hawkerm opened this issue Dec 15, 2020 · 1 comment · Fixed by #3808
Assignees
Milestone

Comments

@hawkerm
Copy link

hawkerm commented Dec 15, 2020

Describe the bug

TileControl throws an exception when the screen resolution of the monitor the app is running on changes (or the app moves to a monitor of a different DPI).

System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
   at Microsoft.Toolkit.Uwp.UI.Controls.TileControl.<>c__DisplayClass45_0.<LoadImageBrushAsync>b__0(LoadedImageSurface s, LoadedImageSourceLoadCompletedEventArgs e)

Steps to Reproduce

  • Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)

Steps to reproduce the behavior:

  1. Open Sample App to TileControl page
  2. Move app from the monitor it's on to a different one with a different DPI setting
  3. Moment later the app will crash

Expected behavior

Not Crash

Environment

NuGet Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: ) 
- [ ] 2019 Preview (version: )

@hawkerm hawkerm added the bug 🐛 An unexpected issue that highlights incorrect behavior label Dec 15, 2020
@ghost ghost added the needs triage 🔍 label Dec 15, 2020
@ghost
Copy link

ghost commented Dec 15, 2020

Hello hawkerm, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@michael-hawker michael-hawker added this to the 7.0 milestone Dec 15, 2020
@michael-hawker michael-hawker added the help wanted Issues identified as good community contribution opportunities label Dec 15, 2020
@Kyaa-dost Kyaa-dost modified the milestones: 7.0, 7.1 Feb 18, 2021
@michael-hawker michael-hawker modified the milestones: 7.1, 7.0 Mar 2, 2021
@michael-hawker michael-hawker self-assigned this Mar 4, 2021
michael-hawker added a commit to michael-hawker/UWPCommunityToolkit that referenced this issue Mar 4, 2021
The LoadCompleted event was never unregistering and firing twice when reloaded across monitors causing an issue with the TaskCompletionSource.
michael-hawker added a commit that referenced this issue Mar 8, 2021
Fixes #3629 TileControl crashes when moving monitors
@ghost ghost added Completed 🔥 and removed help wanted Issues identified as good community contribution opportunities In-PR 🚀 labels Mar 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants