summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Garrido <jimmygarrido@outlook.com>2016-12-02 16:17:38 -0800
committerRui Marinho <me@ruimarinho.net>2016-12-03 00:19:02 +0000
commit0c5f2b8d9fe1243ce240ef53333549247b9f4815 (patch)
tree1c43ab954b456db7fbecc64272b99cd040bbf2f3
parent122a7bd61eeb6c49e1d9a1d3c72a783ac102d0c4 (diff)
downloadxamarin-forms-0c5f2b8d9fe1243ce240ef53333549247b9f4815.tar.gz
xamarin-forms-0c5f2b8d9fe1243ce240ef53333549247b9f4815.tar.bz2
xamarin-forms-0c5f2b8d9fe1243ce240ef53333549247b9f4815.zip
Fix CommandBar overlaying content (#593)release-2.3.3-sr1
-rw-r--r--Xamarin.Forms.Platform.UAP/FormsPresenter.cs35
-rw-r--r--Xamarin.Forms.Platform.UAP/PageControlStyle.xaml2
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs29
-rw-r--r--Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml2
-rw-r--r--Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj1
5 files changed, 38 insertions, 31 deletions
diff --git a/Xamarin.Forms.Platform.UAP/FormsPresenter.cs b/Xamarin.Forms.Platform.UAP/FormsPresenter.cs
new file mode 100644
index 00000000..50400cbd
--- /dev/null
+++ b/Xamarin.Forms.Platform.UAP/FormsPresenter.cs
@@ -0,0 +1,35 @@
+´╗┐using System;
+using Windows.UI.Xaml;
+using Xamarin.Forms;
+
+namespace Xamarin.Forms.Platform.UWP
+{
+ internal class FormsPresenter : Windows.UI.Xaml.Controls.ContentPresenter
+ {
+ public FormsPresenter()
+ {
+ Loaded += FormsPresenter_Loaded;
+ Unloaded += FormsPresenter_Unloaded;
+ SizeChanged += (s, e) =>
+ {
+ if (ActualWidth > 0 && ActualHeight > 0)
+ {
+ var page = (Page)DataContext;
+ ((IPageController)page.RealParent).ContainerArea = new Rectangle(0, 0, ActualWidth, ActualHeight);
+ }
+ };
+ }
+
+ void FormsPresenter_Loaded(object sender, RoutedEventArgs e)
+ {
+ var page = (IPageController)DataContext;
+ page.SendAppearing();
+ }
+
+ void FormsPresenter_Unloaded(object sender, RoutedEventArgs e)
+ {
+ var page = (IPageController)DataContext;
+ page.SendDisappearing();
+ }
+ }
+}
diff --git a/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml b/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml
index 4f3f8835..f90cdeaa 100644
--- a/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml
+++ b/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml
@@ -26,7 +26,7 @@
</uwp:FormsCommandBar>
</Border>
- <ContentPresenter Margin="{TemplateBinding ContentMargin}" ContentTransitions="{TemplateBinding ContentTransitions}" x:Name="presenter" Grid.Row="1" />
+ <uwp:FormsPresenter Margin="{TemplateBinding ContentMargin}" ContentTransitions="{TemplateBinding ContentTransitions}" x:Name="presenter" Grid.Row="1" />
<Border x:Name="BottomCommandBarArea" Grid.Row="2" HorizontalAlignment="Stretch"></Border>
</Grid>
diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
index e9bbd4a1..568267db 100644
--- a/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.UAP/TabbedPageRenderer.cs
@@ -12,35 +12,6 @@ using WGrid = Windows.UI.Xaml.Controls.Grid;
namespace Xamarin.Forms.Platform.UWP
{
- internal class TabbedPagePresenter : Windows.UI.Xaml.Controls.ContentPresenter
- {
- public TabbedPagePresenter()
- {
- Loaded += TabbedPagePresenter_Loaded;
- Unloaded += TabbedPagePresenter_Unloaded;
- SizeChanged += (s, e) =>
- {
- if (ActualWidth > 0 && ActualHeight > 0)
- {
- var tab = (Page)DataContext;
- ((IPageController)tab.RealParent).ContainerArea = new Rectangle(0, 0, ActualWidth, ActualHeight);
- }
- };
- }
-
- void TabbedPagePresenter_Loaded(object sender, RoutedEventArgs e)
- {
- var tab = (IPageController)DataContext;
- tab.SendAppearing();
- }
-
- void TabbedPagePresenter_Unloaded(object sender, RoutedEventArgs e)
- {
- var tab = (IPageController)DataContext;
- tab.SendDisappearing();
- }
- }
-
public class TabbedPageRenderer : IVisualElementRenderer, ITitleProvider, IToolbarProvider
{
const string TabBarHeaderTextBlockName = "TabbedPageHeaderTextBlock";
diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml b/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml
index 1fda50cd..ef7467c4 100644
--- a/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml
+++ b/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml
@@ -14,7 +14,7 @@
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
- <uwp:TabbedPagePresenter Content="{Binding}" ContentTemplate="{ThemeResource ContainedPageTemplate}" />
+ <uwp:FormsPresenter Content="{Binding}" ContentTemplate="{ThemeResource ContainedPageTemplate}" />
</DataTemplate>
</Setter.Value>
</Setter>
diff --git a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
index 72c9245f..66ab6023 100644
--- a/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
+++ b/Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj
@@ -188,6 +188,7 @@
<Compile Include="..\Xamarin.Forms.Platform.WinRT\LayoutExtensions.cs">
<Link>LayoutExtensions.cs</Link>
</Compile>
+ <Compile Include="FormsPresenter.cs" />
<Compile Include="IToolBarForegroundBinder.cs" />
<Compile Include="NativeBindingService.cs" />
<Compile Include="NativeValueConverterService.cs" />