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)
150
150
messageTextBox . Focus ( FocusState . Programmatic ) ;
151
151
}
152
152
153
+ internal void Deselect ( )
154
+ {
155
+ if ( SelectedConversation != null )
156
+ {
157
+ RequestedConversationId = SelectedConversation . ThreadId ;
158
+ }
159
+ SelectedConversation = null ;
160
+ SelectedThread = null ;
161
+ }
162
+
153
163
public void TrySelectConversation ( string conversationId )
154
164
{
155
165
if ( conversationId != null && ConversationsDictionary . ContainsKey ( conversationId ) )
Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ public PageStyle GetCurrentViewStyle()
81
81
82
82
protected override void OnNavigatedTo ( NavigationEventArgs e )
83
83
{
84
- Vm . RequestedConversationId = e . Parameter as string ;
84
+ if ( e . Parameter != null )
85
+ {
86
+ Vm . RequestedConversationId = e . Parameter as string ;
87
+ }
85
88
UpdateLayout ( ) ;
86
89
SwitchToStyle ( GetCurrentViewStyle ( ) ) ;
87
90
MainPanel . DisplayMode = SplitViewDisplayMode . CompactInline ;
@@ -91,6 +94,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
91
94
92
95
protected override void OnNavigatingFrom ( NavigatingCancelEventArgs e )
93
96
{
97
+ Vm . Deselect ( ) ;
94
98
Frame . SizeChanged -= Frame_SizeChanged ;
95
99
if ( GetCurrentViewStyle ( ) == PageStyle . Narrow )
96
100
{
You can’t perform that action at this time.
0 commit comments