Unplanned
Last Updated: 06 Feb 2025 12:37 by Martin Ivanov
Martin Ivanov
Created on: 06 Feb 2025 12:37
Category: Chat
Type: Bug Report
1
Chat: COMException is thrown when MessageGroup elements are removed from the chat

Unhandled COMException is thrown when the MessageGroup elements are removed from the chat's visual tree. This can happen when the group view models are removed from the MessageGroups or MessageListItems collections.

To work this around, you can get the corresponding MessageGroup container and set its DataContext to null before removing the MessageGroupViewModel from the MessageGroups or MessageListItems collections.

 var groupVisuals = chat.ChildrenOfType<MessageGroup>();
 foreach (MessageGroup group in groupVisuals)
 {
     group.DataContext = null;
 }

0 comments