Skip to content
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

XAML Connected Animation crash if using two lists and *same instance* of an object on both lists #1913

Closed
azchohfi opened this issue Mar 20, 2018 · 3 comments

Comments

@azchohfi
Copy link
Contributor

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

If you have two ListViewBase's and both use the same Id (like when you use the same style for the connected animations props) and they share an instance of an object, when navigating to another page, we get an exception at:
https://github.com/Microsoft/UWPCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI.Animations/ConnectedAnimations/ConnectedAnimationHelper.cs#L69
This works fine if it you have two different instances of the items.

Expected behavior

This is not a scenario that we should support, but it should not crash, ever. A simple break after line 69 of ConnectedAnimationHelper.cs should fix it.

Environment

Nuget Package(s): Microsoft.Toolkit.Uwp.UI.Controls

Package Version(s): 2.2.0

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [X] Fall Creators Update (16299)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [X] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

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

Visual Studio 
- [X] 2017 (version: )
- [X] 2017 Preview (version: )

@nmetulev
Copy link
Contributor

Agree, this is not something that we can easily support.

@windowstoolkitbot
Copy link

This issue seems inactive. It will automatically be closed in 14 days if there is no activity.

@nmetulev nmetulev added this to the 3.0 milestone Mar 28, 2018
@azchohfi
Copy link
Contributor Author

azchohfi commented Apr 5, 2018

Turns out it was easy... Just a try catch. \o/

azchohfi added a commit that referenced this issue Apr 5, 2018
OpportunityLiu added a commit to OpportunityLiu/UWPCommunityToolkit that referenced this issue Apr 12, 2018
* Change the background color of items when they are added or removed

* extract method for common logic

* only need to go from the index the item was inserted/removed

* Ignore items to the end of the list, we'll handle that in another method

* unsubscribe from events and remove the list when it's been unloaded

* move methods to the bottom below changed handlers

* unsubscribe from all list events when it is unloaded

* Inherit from HeaderedContentControl to remove duplicate properties

* Change default StepFrequency to 1 to match Slider

* Change sample to use a regular slider for StepFrequency

* Added ItemContainerStyleSelector

ItemContainerStyleSelector allows for code to change the ItemContainerStyle on the fly

* Fix for NavigationView SelectedIndex Bug CommunityToolkit#1905

We would sometimes in error set the SelectedItem to null due to an issue with comparing to the com object from the MenuItems list.

Now we do a safer check and avoid resetting the item if its the same, and if we gave a valid index avoid setting to null if we do fail.

* Strectch the content of the expander header to allow for other content

* Update PULL_REQUEST_TEMPLATE.md

* Use the index from the arguments rather than getting it from the container

* Get the proper command bar added

* Extract command logic

* Removing Moldavian

* Add Initial HeaderStyle Property to Expander

* Move Height of Expander Header into Template

* Update Expander Docs

* fixed relative links in docs

* attempting to fix dependency issue

* updated version of gitversioning

* updated gitversioning version

* revert msbuild.sdk.extras

* Removed obsolete comment from build script

* Remove duplicate compositeTransform.CenterY

* Fixed a NullReferenceException in AdvancedCollectionView Filter
When setting a filter, then resetting it to null,
an exception occured. This has been fixed.

* Fix crash (CommunityToolkit#1913).
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants