Skip to content

Commit 9e4019a

Browse files
committed
Repair the unread marker
1 parent 4536054 commit 9e4019a

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

Signal-Windows/Controls/UnreadMarker.xaml.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,6 @@ public sealed partial class UnreadMarker : UserControl
2323
public UnreadMarker()
2424
{
2525
this.InitializeComponent();
26-
DataContextChanged += UnreadMarker_DataContextChanged;
27-
}
28-
29-
public SignalUnreadMarker Model
30-
{
31-
get
32-
{
33-
return this.DataContext as SignalUnreadMarker;
34-
}
35-
}
36-
37-
private void UnreadMarker_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
38-
{
39-
if (Model != null)
40-
{
41-
UnreadText.Text = Model.Text;
42-
}
4326
}
4427

4528
public void SetText(string text)

Signal-Windows/Controls/VirtualizedMessagesCollection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class VirtualizedCollection : IList, INotifyCollectionChanged
3030
private Dictionary<long, Message> DbIdToMessageMap = new Dictionary<long, Message>();
3131
public SignalConversation Conversation;
3232
Conversation ConversationView;
33-
private SignalUnreadMarker UnreadMarker = new SignalUnreadMarker();
33+
private UnreadMarker UnreadMarker = new UnreadMarker();
3434
public int UnreadMarkerIndex = -1;
3535

3636
public VirtualizedCollection(SignalConversation c, Conversation conversationView)
@@ -40,7 +40,7 @@ public VirtualizedCollection(SignalConversation c, Conversation conversationView
4040
if (Conversation.LastSeenMessageIndex > 0 && Conversation.LastSeenMessageIndex < Conversation.MessagesCount )
4141
{
4242
UnreadMarkerIndex = (int) Conversation.LastSeenMessageIndex;
43-
UnreadMarker.Text = Conversation.UnreadCount > 1 ? $"{Conversation.UnreadCount} new messages" : "1 new message";
43+
UnreadMarker.SetText(Conversation.UnreadCount > 1 ? $"{Conversation.UnreadCount} new messages" : "1 new message");
4444
}
4545
else
4646
{

0 commit comments

Comments
 (0)