summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-06-16 15:45:09 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-06-16 15:45:09 (GMT)
commitd5be2f0144ca810fdfbf59808d526c26fe86017e (patch)
tree3ad7e4465307cd6d633184e05d85eb3a4df59e01 /Xamarin.Forms.Platform.UAP
parent04f7bd296ee67af9189ecd7fdfbd2808ca16ce9a (diff)
downloadxamarin-forms-d5be2f0144ca810fdfbf59808d526c26fe86017e.zip
xamarin-forms-d5be2f0144ca810fdfbf59808d526c26fe86017e.tar.gz
xamarin-forms-d5be2f0144ca810fdfbf59808d526c26fe86017e.tar.bz2
Prep Page for removal of InternalsVisibleTo (#150)
Diffstat (limited to 'Xamarin.Forms.Platform.UAP')
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs9
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs24
2 files changed, 14 insertions, 19 deletions
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
index 6f54e80..c424c7f 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
@@ -55,6 +55,8 @@ namespace Xamarin.Forms.Platform.UWP
{
set { Control.ToolbarForeground = value; }
}
+
+IPageController PageController => Element as IPageController;
IMasterDetailPageController MasterDetailPageController => Element as IMasterDetailPageController;
@@ -196,16 +198,13 @@ namespace Xamarin.Forms.Platform.UWP
if (Element == null)
return;
- Element.SendAppearing();
+ PageController.SendAppearing();
UpdateBounds();
}
void OnControlUnlaoded(object sender, RoutedEventArgs routedEventArgs)
{
- if (Element == null)
- return;
-
- Element.SendDisappearing();
+ PageController?.SendDisappearing();
}
void OnDetailPropertyChanged(object sender, PropertyChangedEventArgs e)
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()