Hello,
what I want to achieve is a bit complex but I always get the exception in the subject.
My goal is to create a page having a SfPopupLayout, a SfNavigationDrawer and a SfListView nested in another SfListView. If I create the page piece by piece, starting from the nested SfListView, I can compile and view the result until I put the last step, despite what this step is: SfListView + SfListView + SfNavigationDrawer works, SfListView + SfListView + SfPopupLayout works, SfListView + SfListView + SfNavigationDrawer + SfPopupLayout doesn't work, SfListView + SfListView + SfPopupLayout + SfNavigationDrawer doesn't work.
The listviews read data from a SQLite database and everything is binded in MVVM pattern.
Here's the relevant part of my code:
<sfPopup:SfPopupLayout x:Name="popUpLayout" HorizontalOptions="FillAndExpand" IsOpen="{Binding IsOpenAlert, Mode=TwoWay}" VerticalOptions="FillAndExpand">
<sfPopup:SfPopupLayout.Content HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<navigationdrawer:SfNavigationDrawer x:Name="navigationDrawer" BackgroundColor="{StaticResource AppBackgroundColor}" DrawerHeaderHeight="200" DrawerWidth="300" HorizontalOptions="FillAndExpand" IsOpen="{Binding IsOpen, Mode=TwoWay}" VerticalOptions="FillAndExpand">
<navigationdrawer:SfNavigationDrawer.DrawerHeaderView>...</navigationdrawer:SfNavigationDrawer.DrawerHeaderView>
<navigationdrawer:SfNavigationDrawer.DrawerContentView>...</navigationdrawer:SfNavigationDrawer.DrawerContentView>
<navigationdrawer:SfNavigationDrawer.ContentView>
<Grid BackgroundColor="{StaticResource AppBackgroundColor}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackLayout Margin="0" Padding="0" HorizontalOptions="FillAndExpand" Orientation="Horizontal" VerticalOptions="FillAndExpand">
<Button />
<Label />
</StackLayout>
<StackLayout Grid.Column="1" Margin="0" Padding="0" HorizontalOptions="FillAndExpand" Orientation="Horizontal" VerticalOptions="FillAndExpand">
<Button />
<Button />
<Button />
</StackLayout>
<listView:SfListView x:Name="listView" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,20,0,0" AutoFitMode="Height" ItemsSource="{Binding ListaStati}" Loaded="ListView_Loaded">
<listView:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid Margin="0,0,0,15">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackLayout Margin="0" Padding="20,0,0,0" HorizontalOptions="FillAndExpand" Orientation="Horizontal" VerticalOptions="FillAndExpand">
<Image Aspect="AspectFit" Source="{Binding Immagine}" VerticalOptions="CenterAndExpand" />
<Label Margin="10,0,0,0" FontAttributes="Bold" FontSize="Medium" Text="{Binding DescStato}" VerticalOptions="CenterAndExpand" VerticalTextAlignment="Center" />
</StackLayout>
<ctrl:ExtendedListView Grid.Row="1" AutoFitMode="Height" HeightRequest="{Binding InnerListHeight}" ItemSize="200" ItemsSource="{Binding Audits}" Orientation="Horizontal" SelectionMode="SingleDeselect">
<ctrl:ExtendedListView.ItemTemplate>
<DataTemplate>
<local:AuditViewTabletMode />
</DataTemplate>
</ctrl:ExtendedListView.ItemTemplate>
</ctrl:ExtendedListView>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</listView:SfListView.ItemTemplate>
</listView:SfListView>
</Grid>
</navigationdrawer:SfNavigationDrawer.ContentView>
</navigationdrawer:SfNavigationDrawer>
</sfPopup:SfPopupLayout.Content>
<sfPopup:SfPopupLayout.PopupView>
<local:PopUpLogout AcceptButtonText="{i18n:Translate Text=ConfirmButtonText}" AcceptCommand="{Binding AcceptButtonCustomCommand}" DeclineButtonText="{i18n:Translate Text=CancelButtonText}" DeclineCommand="{Binding DeclineButtonCustomCommand}" />
</sfPopup:SfPopupLayout.PopupView>
</sfPopup:SfPopupLayout>
The ExtendedListView class is taken from one of your examples (
here)
How can I achieve the result?
Thanks in advance,
Matteo