Skip to content

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

Description

@Yuki-Codes

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}}")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions