Hi
I have a problem when I use SfNavigationDrawer in a application level ControlTemplate with a ContentPresenter.
More exactly my App.xaml looks like this:
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:navigationdrawer="clr-namespace:Syncfusion.SfNavigationDrawer.XForms;assembly=Syncfusion.SfNavigationDrawer.XForms"
x:Class="NavDrawer.App">
<Application.Resources>
<ResourceDictionary>
<ControlTemplate x:Key="MyTemplate">
<navigationdrawer:SfNavigationDrawer x:Name="navigationDrawer" DrawerHeaderHeight="160">
<navigationdrawer:SfNavigationDrawer.ContentView>
<Grid x:Name="mainContentView" BackgroundColor="White">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackLayout BackgroundColor="#1aa1d6" Orientation="Horizontal">
<Button x:Name="hamburgerButton" HeightRequest="50" WidthRequest="50" HorizontalOptions="Start" FontSize="20" BackgroundColor="#1aa1d6"/>
<Label HeightRequest="50" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Text="Home" FontSize="16" TextColor="White" BackgroundColor="#1aa1d6"/>
</StackLayout>
<ContentPresenter Grid.Row="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"></ContentPresenter>
</Grid>
</navigationdrawer:SfNavigationDrawer.ContentView>
<navigationdrawer:SfNavigationDrawer.DrawerHeaderView>
<Label Text="James Pollock" Grid.Row="1" HorizontalTextAlignment="Center" HorizontalOptions="Center" FontSize="20" TextColor="White"/>
</navigationdrawer:SfNavigationDrawer.DrawerHeaderView>
<navigationdrawer:SfNavigationDrawer.DrawerContentView>
<Label HeightRequest="50" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"
Text="Drawer Content View" FontSize="16" TextColor="White" BackgroundColor="#1aa1d6"/>
</navigationdrawer:SfNavigationDrawer.DrawerContentView>
</navigationdrawer:SfNavigationDrawer>
</ControlTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>
The ContentView part of SfNavigationDrawer contains a ContentPresenter that should be populated with content at runtime.
My main page (the content I wanna put into ContentPresenter) looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:NavDrawer"
x:Class="NavDrawer.MainPage">
<ContentView x:Name="contentView" Padding="0,20,0,0"
ControlTemplate="{StaticResource MyTemplate}" BackgroundColor="AliceBlue">
<StackLayout VerticalOptions="CenterAndExpand" BackgroundColor="Red">
<Label Text="Main Page" HorizontalOptions="Center" />
</StackLayout>
</ContentView>
</ContentPage>
Normally, the content of MainPage.xaml wil be loaded into that ContentPresenter from the ControlTemplate. On Android this happens but on iOS NOT. On iOS everything gets displayed except the ContentPresenter.
It may be a bug of the control or I dont know. Any help or suggestions will be appreciated.
For testing I used:
iPhone 7 simulator with iOS 10.3
Xamarin.Forms version="2.3.4.247"
Syncfusion.Xamarin.SfNavigationDrawer.IOS version="15.2.0.46"
Syncfusion.Xamarin.SfNavigationDrawer version="15.2.0.46"
Thank you!