Skip to content

Commit 22519ed

Browse files
committed
Only register Window.Current.Activated once
1 parent 2704e77 commit 22519ed

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Signal-Windows/Controls/Conversation.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ public Conversation()
117117
Separator.Foreground = Utils.ForegroundIncoming;
118118
Username.Foreground = Utils.ForegroundIncoming;
119119
SendButtonEnabled = false;
120+
Loaded += Conversation_Loaded;
121+
Unloaded += Conversation_Unloaded;
122+
}
123+
124+
private void Conversation_Unloaded(object sender, RoutedEventArgs e)
125+
{
126+
Window.Current.Activated -= HandleWindowActivated;
127+
}
128+
129+
private void Conversation_Loaded(object sender, RoutedEventArgs e)
130+
{
120131
Window.Current.Activated += HandleWindowActivated;
121132
}
122133

0 commit comments

Comments
 (0)