Fixing the leak in calendar mmode.
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
xmlns:viewModels="using:Wino.Calendar.ViewModels.Data"
|
xmlns:viewModels="using:Wino.Calendar.ViewModels.Data"
|
||||||
x:Name="Root"
|
x:Name="Root"
|
||||||
SizeChanged="ControlSizeChanged"
|
SizeChanged="ControlSizeChanged"
|
||||||
|
Unloaded="ControlUnloaded"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
|
|||||||
@@ -324,6 +324,13 @@ public sealed partial class CalendarPeriodControl : UserControl, INotifyProperty
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ControlUnloaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
DetachCurrentItemsSource();
|
||||||
|
_sizeRefreshTimer.Stop();
|
||||||
|
_sizeRefreshTimer.Tick -= SizeRefreshTimerTick;
|
||||||
|
}
|
||||||
|
|
||||||
private void SizeRefreshTimerTick(DispatcherQueueTimer sender, object args)
|
private void SizeRefreshTimerTick(DispatcherQueueTimer sender, object args)
|
||||||
{
|
{
|
||||||
sender.Stop();
|
sender.Stop();
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ public sealed partial class CalendarPage : CalendarPageAbstract, ITitleBarSearch
|
|||||||
base.OnNavigatingFrom(e);
|
base.OnNavigatingFrom(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PrepareForClose()
|
||||||
|
{
|
||||||
|
DetachNavigationLifetimeEvents();
|
||||||
|
base.PrepareForClose();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnNavigatedTo(e);
|
base.OnNavigatedTo(e);
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ public sealed partial class WinoAppShell : Views.Abstract.WinoAppShellAbstract,
|
|||||||
{
|
{
|
||||||
ViewModel.StatePersistenceService.IsEventDetailsVisible = false;
|
ViewModel.StatePersistenceService.IsEventDetailsVisible = false;
|
||||||
ViewModel.CalendarClient.Deactivate();
|
ViewModel.CalendarClient.Deactivate();
|
||||||
|
WindowCleanupHelper.CleanupFrame(InnerShellFrame);
|
||||||
|
GC.Collect();
|
||||||
}
|
}
|
||||||
else if (_activeMode == WinoApplicationMode.Contacts)
|
else if (_activeMode == WinoApplicationMode.Contacts)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user