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

Exception when casting from {{DisconectedItem}} to Collection Type #3

Open
Yuki-Codes opened this issue Nov 1, 2017 · 1 comment
Open
Labels

Comments

@Yuki-Codes
Copy link

If the treeview contents are changed during MouseDown an Exception is thrown when the mouse is released.

SelectionMultiple.OnMouseUp(MousebuttonEventArgs) [Line 267] Should probably check if the selectItem.DataContext has been set to a DisconnectedSource before attempting to select the item.

In .Net 4.5+ this can be done with if (selectItem.DataContext == BindingOperations.DisconnectedSource) however in earlier .NET versions the only way to check is with a string compare like if ((string)selectItem.DataContext == "{{DisconectedItem}}")

@nkast nkast added the bug label Nov 1, 2017
@nkast
Copy link
Contributor

nkast commented Nov 1, 2017

Is there an easy way to reproduce this? Preferably from within one of the existing samples.
I guess this happens when the selected item(s) is removed from the list, right?

I would prefer to keep supporting the .net 4.0 framework or find a better solution to this, for example check if the items is still part of the list or update the state of SelectionMultiple when the tree changes and items are removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants