@@ -25,6 +25,7 @@ public sealed partial class Properties : Page
25
25
private static ApplicationViewTitleBar TitleBar ;
26
26
27
27
private CancellationTokenSource tokenSource = new CancellationTokenSource ( ) ;
28
+ private ContentDialog propertiesDialog ;
28
29
29
30
private object navParameter ;
30
31
@@ -35,6 +36,7 @@ public sealed partial class Properties : Page
35
36
public Properties ( )
36
37
{
37
38
InitializeComponent ( ) ;
39
+ propertiesDialog = Interaction . FindParent < ContentDialog > ( this ) ;
38
40
}
39
41
40
42
protected override void OnNavigatedTo ( NavigationEventArgs e )
@@ -63,7 +65,6 @@ private async void Properties_Loaded(object sender, RoutedEventArgs e)
63
65
}
64
66
else
65
67
{
66
- var propertiesDialog = Interaction . FindParent < ContentDialog > ( this ) ;
67
68
propertiesDialog . Closed += PropertiesDialog_Closed ;
68
69
}
69
70
}
@@ -125,6 +126,7 @@ private void PropertiesDialog_Closed(ContentDialog sender, ContentDialogClosedEv
125
126
tokenSource . Dispose ( ) ;
126
127
tokenSource = null ;
127
128
}
129
+ propertiesDialog . Hide ( ) ;
128
130
}
129
131
130
132
private void Properties_Unloaded ( object sender , RoutedEventArgs e )
@@ -178,7 +180,6 @@ private async void OKButton_Click(object sender, RoutedEventArgs e)
178
180
}
179
181
else
180
182
{
181
- var propertiesDialog = Interaction . FindParent < ContentDialog > ( this ) ;
182
183
propertiesDialog . Hide ( ) ;
183
184
}
184
185
}
@@ -191,7 +192,6 @@ private async void CancelButton_Click(object sender, RoutedEventArgs e)
191
192
}
192
193
else
193
194
{
194
- var propertiesDialog = Interaction . FindParent < ContentDialog > ( this ) ;
195
195
propertiesDialog . Hide ( ) ;
196
196
}
197
197
}
@@ -206,7 +206,6 @@ private async void Page_KeyDown(object sender, KeyRoutedEventArgs e)
206
206
}
207
207
else
208
208
{
209
- var propertiesDialog = Interaction . FindParent < ContentDialog > ( this ) ;
210
209
propertiesDialog . Hide ( ) ;
211
210
}
212
211
}
0 commit comments