I have a ContentPage with some controls and I made a custom control
(using ContentView), this custom control has a SfDataGrid and I need to
show a modal popup with actions when the user tap any row. This
behaviour is done fine using the SfPopupLayout directly in the
ContentPage, but when I want to use it inside of ContentView, the page
stay white (nothing happens) like if the control have IsVisible=false,
the Content is not shown.
What I missing?
ProductTemplate custom control:
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:helpers="clr-namespace:Transportation.Helpers"
xmlns:controls="clr-namespace:Transportation.Controls"
xmlns:combobox="clr-namespace:Syncfusion.XForms.ComboBox;assembly=Syncfusion.SfComboBox.XForms"
xmlns:syncfusion="clr-namespace:Syncfusion.SfDataGrid.XForms;assembly=Syncfusion.SfDataGrid.XForms"
xmlns:inputLayout="clr-namespace:Syncfusion.XForms.TextInputLayout;assembly=Syncfusion.Core.XForms"
xmlns:datepicker="clr-namespace:Syncfusion.XForms.Pickers;assembly=Syncfusion.SfPicker.XForms"
xmlns:sfPopup="clr-namespace:Syncfusion.XForms.PopupLayout;assembly=Syncfusion.SfPopupLayout.XForms"
x:Class="Transportation.Controls.ProductTemplate">
<sfPopup:SfPopupLayout x:Name="popupLayout">
<sfPopup:SfPopupLayout.Content>
<StackLayout>
..... my controls here
</sfPopup:SfPopupLayout.Content>
<sfPopup:SfPopupLayout.PopupView>
<sfPopup:PopupView>
<sfPopup:PopupView.ContentTemplate>
<DataTemplate>
<StackLayout Padding="30,30,30,20">
<Button
x:Name="btnEditar"
Clicked="btnEditar_Clicked"
Text="{helpers:Translate Editar}">
<Button.ImageSource>
<FontImageSource
FontFamily="MaterialDesignIcons"
Glyph="{x:Static helpers:MaterialDesignIcons.PlaylistEdit}"
Size="23"
Color="{StaticResource ButtonColor}" />
</Button.ImageSource>
</Button>
<BoxView HeightRequest="1" Color="{StaticResource ButtonColor}" />
<Button
x:Name="btnEliminar"
Clicked="btnEliminar_Clicked"
Text="{helpers:Translate Eliminar}">
<Button.ImageSource>
<FontImageSource
FontFamily="MaterialDesignIcons"
Glyph="{x:Static helpers:MaterialDesignIcons.DeleteForever}"
Size="23"
Color="{StaticResource ButtonColor}" />
</Button.ImageSource>
</Button>
</StackLayout>
</DataTemplate>
</sfPopup:PopupView.ContentTemplate>
</sfPopup:PopupView>
</sfPopup:SfPopupLayout.PopupView>
</sfPopup:SfPopupLayout>
</ContentView>
Page.xaml (using tabs, I tested in another single Page and the result is the same):
<tabView:SfTabItem.Content>
<ScrollView>
<StackLayout >
<controls:ProductTemplate x:Name="Detail" />
</StackLayout>
</ScrollView>
</tabView:SfTabItem.Content>
</tabView:SfTabItem>
Is
it possible to use SfPopupLayout inside of a ContentView? I couldn't
use it because the PopupView.ContentTemplate is not shown in the Page
that invoke the ContentView, in the code in the first post I show the
xaml that I'm using.
If
I use the popup inside of a Page directly, it works fine, but I want to use the SfPopupLayout in a custom control
(ContentView), that content simply doesn't show them.