I'm basically trying to create a custom "container" view, which will render differently on each platform, but its content will render the standard way. Specifically this would be like a menu item which contains complicated views, but the outter decoration remains the same in all cases. You cam imagine it something like this
but the container could contain any arbitrary Xamarin.Forms views, for example a layout with multiple views that would still render the normal way (or using their own custom renderers). The decoration would be the only thing that is platform specific.
How should I approach this? I could have a Content
property on my container view, which would have the type View
, and then somehow render that on each platform's renderer. But how do I take a View
and render it in a platform specific way? A sample usage might be like this.
var foo = new Label { Text = "foo" };
var bar = new Label { Text = "bar" };
var box = new DecoratedBox { Content = new StackLayout { Children = { foo, bar } } };