Skip to content

TileControl crash when Resolution Changes #3629

@hawkerm

Description

@hawkerm

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: )

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions