summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs24
1 files changed, 10 insertions, 14 deletions
diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
index cde4071..7a9f181 100644
--- a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
@@ -20,20 +20,20 @@ namespace Xamarin.Forms.Platform.UWP
if (ActualWidth > 0 && ActualHeight > 0)
{
var tab = (Page)DataContext;
- ((TabbedPage)tab.RealParent).ContainerArea = new Rectangle(0, 0, ActualWidth, ActualHeight);
+ ((IPageController)tab.RealParent).ContainerArea = new Rectangle(0, 0, ActualWidth, ActualHeight);
}
};
}
void TabbedPagePresenter_Loaded(object sender, RoutedEventArgs e)
{
- var tab = (Page)DataContext;
+ var tab = (IPageController)DataContext;
tab.SendAppearing();
}
void TabbedPagePresenter_Unloaded(object sender, RoutedEventArgs e)
{
- var tab = (Page)DataContext;
+ var tab = (IPageController)DataContext;
tab.SendDisappearing();
}
}
@@ -78,6 +78,8 @@ namespace Xamarin.Forms.Platform.UWP
set { (Control as FormsPivot).ToolbarForeground = value; }
}
+ IPageController PageController => Element as IPageController;
+
bool ITitleProvider.ShowTitle
{
get { return _showTitle; }
@@ -190,7 +192,7 @@ namespace Xamarin.Forms.Platform.UWP
return;
_disposed = true;
- Element?.SendDisappearing();
+ PageController?.SendDisappearing();
SetElement(null);
Tracker = null;
}
@@ -215,10 +217,7 @@ namespace Xamarin.Forms.Platform.UWP
void OnLoaded(object sender, RoutedEventArgs args)
{
- if (Element == null)
- return;
-
- Element.SendAppearing();
+ PageController?.SendAppearing();
}
void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e)
@@ -238,17 +237,14 @@ namespace Xamarin.Forms.Platform.UWP
Page currentPage = Element.CurrentPage;
if (currentPage == page)
return;
- currentPage?.SendDisappearing();
+ ((IPageController)currentPage)?.SendDisappearing();
Element.CurrentPage = page;
- page?.SendAppearing();
+ ((IPageController)page)?.SendAppearing();
}
void OnUnloaded(object sender, RoutedEventArgs args)
{
- if (Element == null)
- return;
-
- Element.SendDisappearing();
+ PageController?.SendDisappearing();
}
Brush GetBarBackgroundBrush()