Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Creating a custom control with a Content property

$
0
0

I'm trying to create a control that will host other content but the content doesn't layout properly.

My custom control descends from Grid and has a number of UI elements (it's the common shell for a collection of screens). Then, in the place where I want content to be, I have an empty ContentView control.

My expectation was that each of my ContentPages would have a which would layout the PageSpecificContent into the ContentView of MyCustomControl. Instead, everything renders, but PageSpecificContent is not within the ContentView, rather it seems to render to the same origin as MyCustomControl (overlapping top-left).

Am I completely off track? I know I can create multiple ContentViews (one for each page) then a single ContentPage to navigate between them, but I'd prefer this approach. On Windows Phone, this would work fine. What should I do differently?

Thanks!


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>