File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,16 @@ internal async Task SendMessageButton_Click(TextBox messageTextBox)
150150 messageTextBox . Focus ( FocusState . Programmatic ) ;
151151 }
152152
153+ internal void Deselect ( )
154+ {
155+ if ( SelectedConversation != null )
156+ {
157+ RequestedConversationId = SelectedConversation . ThreadId ;
158+ }
159+ SelectedConversation = null ;
160+ SelectedThread = null ;
161+ }
162+
153163 public void TrySelectConversation ( string conversationId )
154164 {
155165 if ( conversationId != null && ConversationsDictionary . ContainsKey ( conversationId ) )
Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ public PageStyle GetCurrentViewStyle()
8181
8282 protected override void OnNavigatedTo ( NavigationEventArgs e )
8383 {
84- Vm . RequestedConversationId = e . Parameter as string ;
84+ if ( e . Parameter != null )
85+ {
86+ Vm . RequestedConversationId = e . Parameter as string ;
87+ }
8588 UpdateLayout ( ) ;
8689 SwitchToStyle ( GetCurrentViewStyle ( ) ) ;
8790 MainPanel . DisplayMode = SplitViewDisplayMode . CompactInline ;
@@ -91,6 +94,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
9194
9295 protected override void OnNavigatingFrom ( NavigatingCancelEventArgs e )
9396 {
97+ Vm . Deselect ( ) ;
9498 Frame . SizeChanged -= Frame_SizeChanged ;
9599 if ( GetCurrentViewStyle ( ) == PageStyle . Narrow )
96100 {
You can’t perform that action at this time.
0 commit comments