Skip to content

Commit aca680a

Browse files
committed
add nice comment for our itemssource hack
1 parent e52aafc commit aca680a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Signal-Windows/Controls/Conversation.xaml.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ public void Load(SignalConversation conversation)
119119
InputTextBox.IsEnabled = false;
120120
DisposeCurrentThread();
121121
UpdateHeader(conversation);
122-
ConversationItemsControl.ItemsSource = new List<object>(); /* hack to avoid glitches */
122+
123+
/*
124+
* When selecting a small (~650 messages) conversation after a bigger (~1800 messages) one,
125+
* ScrollToBottom would scroll so far south that the entire screen was white. Seems like the
126+
* scrollbar is not properly notified that the collection changed. I tried things like throwing
127+
* CollectionChanged (reset) event, but to no avail. This hack works, though.
128+
*/
129+
ConversationItemsControl.ItemsSource = new List<object>();
123130
UpdateLayout();
124131
Collection = new VirtualizedCollection(conversation);
125132
ConversationItemsControl.ItemsSource = Collection;

0 commit comments

Comments
 (0)