Let's say I have the following ContentPage:
public class HomePage : ContentPage
{
View _tabsView;
RelativeLayout relativeLayout;
PageViewModel viewModel;
public HomePage()
{
viewModel = new PageViewModel();
BindingContext = viewModel;
relativeLayout = new RelativeLayout
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand
};
var pages = CreatePages();
_tabs = CreateTabs();
var tabsHeight = 50;
relativeLayout.Children.Add (_tabsView,
Constraint.Constant (0),
Constraint.RelativeToParent ((parent) => { return parent.Height - tabsHeight; }),
Constraint.RelativeToParent (parent => parent.Width),
Constraint.Constant (tabsHeight)
);
relativeLayout.Children.Add (pages,
Constraint.RelativeToParent ((parent) => { return parent.X; }),
Constraint.RelativeToParent ((parent) => { return parent.Y; }),
Constraint.RelativeToParent ((parent) => { return parent.Width; }),
Constraint.RelativeToView (_tabs, (parent, sibling) => { return parent.Height - (sibling.Height); })
);
Content = relativeLayout;
}
}
Rather than set Content to be a view is there a way to set Content to be another ContentPage?