I have created this popup layou but when i call show method i have null exception, here below the code behind the view
popUpLayout.PopupView.HeaderTitle = "Segnalazioni";
popUpLayout.PopupView.AppearanceMode = AppearanceMode.OneButton;
public DocView()
{
InitializeComponent();
TapGestureRecognizer t = new TapGestureRecognizer();
t.NumberOfTapsRequired = 1;
t.Tapped += T_Tapped;
GridSub.GestureRecognizers.Add(t);
popUpLayout.PopupView.HeaderTitle = "Segnalazioni";
popUpLayout.PopupView.AppearanceMode = AppearanceMode.OneButton;
popupContent = new Label();
popupContent.Text = "Manca il tipo pagamento";
popupContent.BackgroundColor = Color.LightSkyBlue;
popupContent.HorizontalTextAlignment = TextAlignment.Center;
templateView = new DataTemplate(() => popupContent);
popUpLayout.PopupView.ContentTemplate = templateView;
popUpLayout.PopupView.AcceptButtonText = "OK";
//popUpLayout.Show();
}
private void T_Tapped(object sender, EventArgs e)
{
try
{
popUpLayout.Show();
}
catch (Exception Ex)
{
}
}
in the xaml
<sfPopup:SfPopupLayout x:Name="popUpLayout">
<sfPopup:SfPopupLayout.Content>
<Grid RowSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="52"/>
<RowDefinition />
<RowDefinition Height="45"/>
</Grid.RowDefinitions>
<iMioCoreControls:iMioCommandBar x:Name="CommandBar" ShowBackIcon="False" Grid.Row="0" Title="VORD Num.: 11443 del 21/02/2018"/>
<sftabView:SfTabView Grid.Row="1" DisplayMode="Text" TabHeaderBackgroundColor="{StaticResource Primary}" VisibleHeaderCount="3" EnableSwiping="False">
<sftabView:SfTabView.SelectionIndicatorSettings>
<sftabView:SelectionIndicatorSettings Color="White" Position="Bottom" StrokeThickness="3" />
</sftabView:SfTabView.SelectionIndicatorSettings>
<ControlLocal:mySfTabItem Title="Testata">
<ControlLocal:mySfTabItem.Content>
<view:DocHeaderView />
</ControlLocal:mySfTabItem.Content>
</ControlLocal:mySfTabItem>
<ControlLocal:mySfTabItem Title="Righe">
<ControlLocal:mySfTabItem.Content>
<view:DocRowView />
</ControlLocal:mySfTabItem.Content>
</ControlLocal:mySfTabItem>
<ControlLocal:mySfTabItem Title="Note">
<ControlLocal:mySfTabItem.Content>
<view:DocNoteView />
</ControlLocal:mySfTabItem.Content>
</ControlLocal:mySfTabItem>
</sftabView:SfTabView>
<!-- BOTTOM COMMAND BAR -->
<Grid Grid.Row="2" ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<!--Cancel Button-->
<iMioCoreControls:iMioGridButton Grid.Column="0" BackgroundColor="{StaticResource ButtonCancelColor}" IconText="{ x:Static iMioCore:FontAwesomeFont.Undo }" Command="{Binding BackCommand}"/>
<!--Totale Doc-->
<Grid Grid.Column="1" BackgroundColor="{StaticResource Primary}" Padding="8,5">
<Grid ColumnSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="40"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<iMioCoreControls:iMioGridButton Grid.Column="1" BackgroundColor="{StaticResource Primary}" IconText="{ Binding ImageCheck}" HorizontalOptions="Start" VerticalOptions="Center"/>
<Grid x:Name="GridSub" Grid.Column="0">
<Label Text="{Binding Path = TotAlert }" HorizontalOptions="Start" VerticalOptions="Center" FontAttributes="Bold" TextColor="White" />
</Grid>
<Label Text="{Binding Path = Documento.TotaleImponibile, StringFormat='{0:N}'}" HorizontalOptions="End" VerticalOptions="Center" FontAttributes="Bold" TextColor="White" Grid.Column="2" />
</Grid>
</Grid>
<!--Save Button-->
<iMioCoreControls:iMioGridButton Grid.Column="2" BackgroundColor="{StaticResource ButtonSaveColor}" IconText="{ x:Static iMioCore:FontAwesomeFont.Save }" Command="{Binding SaveCommand}"/>
</Grid>
</Grid>
</sfPopup:SfPopupLayout.Content>
</sfPopup:SfPopupLayout>