Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
feedback addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
paymicro committed May 14, 2018
1 parent cdbe16b commit 708cb15
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Xamarin.Forms.Core/ContentPage.cs
@@ -1,7 +1,7 @@
namespace Xamarin.Forms
{
[ContentProperty("Content")]
public class ContentPage : TemplatedPage
public class ContentPage : TemplatedPage, IControlTemplatedWithContent
{
public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(ContentPage), null, propertyChanged: TemplateUtilities.OnContentChanged);

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.Core/ContentView.cs
@@ -1,7 +1,7 @@
namespace Xamarin.Forms
{
[ContentProperty("Content")]
public class ContentView : TemplatedView
public class ContentView : TemplatedView, IControlTemplatedWithContent
{
public static readonly BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(ContentView), null, propertyChanged: TemplateUtilities.OnContentChanged);

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.Core/IControlTemplated.cs
Expand Up @@ -2,7 +2,7 @@

namespace Xamarin.Forms
{
internal interface IControlTemplated
public interface IControlTemplated
{
ControlTemplate ControlTemplate { get; set; }

Expand Down
7 changes: 7 additions & 0 deletions Xamarin.Forms.Core/IControlTemplatedWithContent.cs
@@ -0,0 +1,7 @@
namespace Xamarin.Forms
{
public interface IControlTemplatedWithContent : IControlTemplated
{
View Content { get; set; }
}
}
6 changes: 3 additions & 3 deletions Xamarin.Forms.Platform.WPF/FormsContentLoader.cs
Expand Up @@ -58,9 +58,9 @@ private object CreateOrResizeContent(FrameworkElement parent, VisualElement visu
visualElement.Layout(actualRect);

// ControlTemplate adds an additional layer through which to send sizing changes.
var contentPage = visualElement as ContentPage;
if (contentPage?.ControlTemplate != null)
contentPage.Content?.Layout(actualRect);
var control = visualElement as IControlTemplatedWithContent;
if (control?.ControlTemplate != null)
control.Content?.Layout(actualRect);

IPageController pageController = visualElement.RealParent as IPageController;
if (pageController != null)
Expand Down

0 comments on commit 708cb15

Please sign in to comment.