Dynamic picker elements in ListView - xamarin

I am new to Xamarin forms.I am designing an application in which I want to display a list of pickers in a list view.The vales in the picker should be dynamic.Below is the code I have written.I struck at writing a List of Picker items in a List.Please anyone help me.Sorry for my English.Thanks in advance.
<ListView x:Name="WindowsList" BackgroundColor="Transparent"
ItemsSource="{Binding KitchenWindowsList}"
HeightRequest="300" IsVisible="{Binding KitchenVisibility}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="5" HorizontalOptions="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding KitchenWindowName}" TextColor="#ece6dd" FontAttributes="Bold">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="15" Android="15" WinPhone="15" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="20" Android="20" WinPhone="20" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
<Picker x:Name="CurtainTypePicker" ItemsSource="{Binding TypeList}" Title="Choose Curtain" Grid.Column="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Picker.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40"/>
</OnIdiom.Tablet>
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="45"/>
</OnIdiom.Phone>
</OnIdiom>
</Picker.HeightRequest>
</Picker>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

Related

Xamarin forms shell navigation flickering

I have a xamarin.forms app in which I am using shell. The problem I am facing is when I navigate from shell bottom navigation to any inner page and navigate back to previous page there is a flicker occurring.Please refer the screen record https://drive.google.com/open?id=1861iNlcV7ao6oDUNu7nL4WiyFuWjwXx_.
My Shell Page
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Shell.NavBarIsVisible="False"
xmlns:local="clr-namespace:PaTS.Views"
x:Class="SampleApp.AppShell">
<TabBar>
<Tab Title="Dashboard" Icon="icon_dashboard.png" >
<ShellContent ContentTemplate="{DataTemplate local:Dashboard}" />
</Tab>
<Tab Title="Notifications" Icon="icon_notifications.png">
<ShellContent ContentTemplate="{DataTemplate local:Dashboard}" />
</Tab>
<Tab Title="Account" Icon="icon_user.png">
<ShellContent ContentTemplate="{DataTemplate local:Dashboard}" />
</Tab>
</TabBar>
</Shell>
Dashboard page
<?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:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:ImageCircle.Forms.Plugin.Abstractions;assembly=ImageCircle.Forms.Plugin"
xmlns:local="clr-namespace:sample.CustomRender"
mc:Ignorable="d"
BackgroundColor="#004d6f"
Title="Dashboard"
x:Class="sample.Views.Dashboard">
<ContentPage.Content>
<Grid>
<!--<Image Aspect="AspectFill" >
<Image.Source>
<OnIdiom x:TypeArguments="FileImageSource" Tablet="cover.jpg" Phone="loginbackground_phone.jpg" />
</Image.Source>
</Image>-->
<Grid >
<Grid.RowDefinitions >
<RowDefinition Height="0.9*"/>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" BackgroundColor="#004d6f">
<StackLayout BackgroundColor="Transparent" IsClippedToBounds="True" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" >
<Grid HorizontalOptions="Start" VerticalOptions="Center">
<controls:CircleImage
BorderColor="LightBlue"
BorderThickness="2"
Source="sampleuser.png"
Aspect="AspectFill">
<Image.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="20,30,15,0" />
<On Platform="Android" Value="20,15,15,0" />
</OnPlatform>
</Image.Margin>
<Image.HeightRequest>
<OnIdiom x:TypeArguments="x:Double" Tablet="60" Phone="30" />
</Image.HeightRequest>
</controls:CircleImage>
<controls:CircleImage
x:Name="UserImage"
BorderColor="LightBlue"
BorderThickness="2"
Source="sampleuser.png"
Aspect="AspectFill">
<Image.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="20,30,15,0" />
<On Platform="Android" Value="20,15,15,0" />
</OnPlatform>
</Image.Margin>
<Image.HeightRequest>
<OnIdiom x:TypeArguments="x:Double" Tablet="60" Phone="30" />
</Image.HeightRequest>
</controls:CircleImage>
</Grid>
<Label Text="Welcome" HorizontalOptions="Start" VerticalOptions="Center" MaxLines="1" TextColor="White">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Regular" />
<On Platform="Android" Value="Montserrat-Regular.ttf#Montserrat-Regular" />
</OnPlatform>
</Label.FontFamily>
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double" Tablet="14" Phone="11" />
</Label.FontSize>
<Label.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0,30,0,0" />
<On Platform="Android" Value="0,15,0,0" />
</OnPlatform>
</Label.Margin>
</Label>
<Label x:Name="UserName" MaxLines="1" Text="User" HorizontalOptions="Start" VerticalOptions="Center" TextColor="LightBlue">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Regular" />
<On Platform="Android" Value="Montserrat-Regular.ttf#Montserrat-Regular" />
</OnPlatform>
</Label.FontFamily>
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double" Tablet="14" Phone="11" />
</Label.FontSize>
<Label.Margin>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0,30,0,0" />
<On Platform="Android" Value="0,15,0,0" />
</OnPlatform>
</Label.Margin>
</Label>
</StackLayout>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="150"/>
<RowDefinition Height="50"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="icon_xamarin_logo.png" HorizontalOptions="CenterAndExpand" Margin="0,25,0,0">
</Image>
<Label Grid.Row="1" Text="Sample App" TextColor="White" FontSize="30" Margin="10,5,10,5" HorizontalTextAlignment="Center" >
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
<Label Grid.Row="2" Text="Sample app details™" TextColor="Snow" FontSize="Medium" Margin="10,5,10,10" HorizontalTextAlignment="Center" >
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Regular" />
<On Platform="Android" Value="Montserrat-Regular.ttf#Montserrat-Regular" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</StackLayout>
</Grid>
<Image Grid.Row="1" HorizontalOptions="FillAndExpand" Aspect="AspectFill" Source="CurvedMask.jpg" Margin="-6,0,-6,-6"></Image>
<StackLayout Grid.Row="2" BackgroundColor="White">
<Frame HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Transparent" Margin="15">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Frame Grid.Row="0" Grid.Column="0" CornerRadius="6">
<Frame.GestureRecognizers>
<TapGestureRecognizer
Tapped="Timesheet_Tapped"
NumberOfTapsRequired="1" />
</Frame.GestureRecognizers>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_timesheet.png" Grid.Row="0"></Image>
<Label Text="Timesheets" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
<Frame Grid.Row="0" Grid.Column="2" CornerRadius="6">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_employee.png" Grid.Row="0"></Image>
<Label Text="Employees" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
<Frame Grid.Row="1" Grid.Column="0" CornerRadius="6">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_graph.png" Grid.Row="0"></Image>
<Label Text="Analysis" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
<Frame Grid.Row="1" Grid.Column="2" CornerRadius="6">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Source="icon_info.png" Grid.Row="0"></Image>
<Label Text="Info" Grid.Row="1" HorizontalTextAlignment="Center" TextColor="Gray">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="iOS" Value="Montserrat-Bold" />
<On Platform="Android" Value="Montserrat-Bold.ttf#Montserrat-Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
</Frame>
</Grid>
</Frame>
</StackLayout>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
Page navigation
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Dashboard : ContentPage
{
public Dashboard()
{
InitializeComponent();
}
private async void Timesheet_Tapped(object sender, EventArgs e)
{
await Navigation.PushAsync(new TimesheetList(),true);
}
}
When I navigate to TimesheetList and press back button, It will slide back to dashboard with little flicker. How to resolve this? Any help is appreciated.
I test the code you provided. In the Dashboard page, there is no code you used to for Timesheet_Tapped event.
Try the code below, it works well on my side.
<Image Source="icon_timesheet.png" Grid.Row="0" >
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="Timesheet_Tapped"></TapGestureRecognizer>
</Image.GestureRecognizers>
</Image>
I have the same issue, but in the android emulator Android 9.0 fickering not happend, in my case only Samsung s8, s8+, s9, s9+, s10, s10+ devices.
In this bug report:
https://github.com/xamarin/Xamarin.Forms/issues/8581
That guy finds a workaround, delete animation:
protected override bool OnBackButtonPressed() {
Current.Navigation.PopAsync(false);
return true;
}

Align label and switch in xamarin forms

I want to align the label and switch in xamarin forms. I used grid but the label and switch wont align (see image for reference)
Here is my XAML:
<Grid>
<Label Grid.Row="0" Grid.Column="0" Text="Rekorida" StyleClass="lbl-fieldform">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="HelveticaNeueLTPro-Lt.otf#HelveticaNeueLTPro-Lt"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<Switch Grid.Row="0" Grid.Column="1" VerticalOptions="Start" x:Name="swRekorida" Toggled="Activity_Toggled"/>
</Grid>
Use this:
<Grid VerticalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Label VerticalTextAlignment="Center" Grid.Row="0" Grid.Column="0" Text="Rekorida" StyleClass="lbl-fieldform">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="HelveticaNeueLTPro-Lt.otf#HelveticaNeueLTPro-Lt"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<Switch Grid.Row="0" Grid.Column="1" VerticalOptions="Center" x:Name="swRekorida" Toggled="Activity_Toggled"/>
</Grid>

Application is crashed due to Xamarin.CarouselView in xamarin android project

I have very tied to find out the reason of unexpectedly closing of my xamarin android project. I have used CarouselView in xaml page. When I am navigate to that page application is crashed unexpectedly but it works fine when I run ios project. Actually I am working on portable project. Can you please suggest any idea of this issue. I have posted the my hockeyapp crash report. I think it will help to identify, what the exact cause.Thanks in advance.
Here is hockey app crash report
Here is my code
<cv:CarouselView VerticalOptions = "FillAndExpand" HorizontalOptions =
"FillAndExpand" Position = "{Binding DishCategory}" ItemSelected =
"OnSwipeDishesHandler" ItemsSource = "{Binding RestaurantDishesList}"
x:Name = "RestaurantDishesList">
<cv:CarouselView.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="230" Tablet ="630"/>
</cv:CarouselView.HeightRequest>
<cv:CarouselView.ItemTemplate>
<DataTemplate>
<StackLayout Padding = "10,5,10,5" Orientation = "Vertical">
<ListView x:Name="RestaurantMenuListView" BackgroundColor="Transparent" ItemsSource="{Binding CategoryWiseDishes}" HasUnevenRows="true" SeparatorColor="#eeeeee" ItemTapped="OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="7">
<Grid Padding="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="OnMenuItemSelected"/>
</StackLayout.GestureRecognizers>
<Label Text="{Binding Name}" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="15" Tablet ="20"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Description}" TextColor="#323232">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="11" Tablet ="16"/>
</Label.FontSize>
</Label>
<StackLayout Orientation="Horizontal">
<Label Text="£" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="14" Tablet ="19"/>
</Label.FontSize>
</Label>
<Label Text="{Binding Cost}" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments ="x:Double" Phone ="14" Tablet ="19"/>
</Label.FontSize>
</Label>
</StackLayout>
</StackLayout>
<StackLayout Grid.Column="1" Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Image Source="minus.png">
<Image.WidthRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.WidthRequest>
<Image.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.HeightRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="RemoveItemBtnClicked"/>
</Image.GestureRecognizers>
</Image>
<Label Text="{Binding TotalQuantity}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="Black">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="13" WinPhone="13" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="15" Android="15" WinPhone="15" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
<Image Source="add.png">
<Image.WidthRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.WidthRequest>
<Image.HeightRequest>
<OnIdiom x:TypeArguments ="x:Double" Phone ="25" Tablet ="35"/>
</Image.HeightRequest>
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="AddItemBtnClicked"/>
</Image.GestureRecognizers>
</Image>
</StackLayout>
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</DataTemplate>
</cv:CarouselView.ItemTemplate>
</cv:CarouselView>

How to get selected item of Picker which is inside a ListView?

I am working on a listview in which I have a label and Picker.I want to detect the selected item of the picker which is inside the list view.I am not able to access the x:Name of picker in Xaml.cs file.Below is my code.Any one please help me if i am going in a wrong direction.Thanks in Advance.
Here is my Xaml code:
<ListView x:Name="MasterRoomList" BackgroundColor="Transparent"
ItemsSource="{Binding MasterRoomWindowsList}"
IsVisible="{Binding RoomsVisibility}" ItemTapped="OnItemTapped" SeparatorVisibility="None">
<ListView.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="150" Android="150" WinPhone="150" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="300" Android="300" WinPhone="300" />
</OnIdiom.Tablet>
</OnIdiom>
</ListView.HeightRequest>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Text="{Binding RoomName}" TextColor="Black" FontFamily="Avenir Book" VerticalTextAlignment="Center">
<Label.FontSize>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="13" Android="13" WinPhone="13" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="20" Android="20" WinPhone="20" />
</OnIdiom.Tablet>
</OnIdiom>
</Label.FontSize>
</Label>
<Picker x:Name="CurtainPicker" BackgroundColor="Transparent" TextColor="Black" ItemsSource="{Binding CurtainsTypeList}" SelectedIndexChanged="CurtainPicker_OnSelectedIndexChanged" Title="Select Style" Grid.Column="1" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand">
<Picker.HeightRequest>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40"/>
</OnIdiom.Tablet>
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="x:Double" iOS="30" Android="30"/>
</OnIdiom.Phone>
</OnIdiom>
</Picker.HeightRequest>
</Picker>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Here is my Xaml.cs Code:
private void CurtainPicker_OnSelectedIndexChanged(object sender, EventArgs e)
{
var selectedItem = (string) CurtainPicker.SelectedItem;
}
var picker = (Picker)sender;
var selectedItem = (string) picker.SelectedItem;

Error: Specified cast is not valid. Xaml

I have a xaml, which has a grid with listview and button, and at the
moment of compiling this error appears:
Error: Specified cast is not valid.
I think the problem may be in the listview that is inside the grid, but I have not really been able to find a solution
this is my xaml:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="FCR.App.Views.AdvanceSearchResultPage" Title="AdvanceSearchResultPage" xmlns:extended="clr-namespace:FCR.App.ExtendedClasses;assembly=FCR.App">
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness" iOS="0, 10, 0, 0" WinPhone="20,20,20,20" />
</ContentPage.Padding>
<ContentPage.Content>
<StackLayout VerticalOptions="StartAndExpand">
<ContentView IsVisible="false" x:Name="TitleHC">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="9.5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Source="blue_circle.png" Grid.Column="0" />
<StackLayout Padding="0,4,0,5" VerticalOptions="Fill" Grid.Column="1">
<Label VerticalOptions="CenterAndExpand" TextColor="#0368b1" Text="Histórico de conéxiones" FontSize="20">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<OnPlatform.iOS>FrutigerLTStd-Cn</OnPlatform.iOS>
<OnPlatform.Android>FrutigerLTStd-Cn.otf#FrutigerLTStd-Cn</OnPlatform.Android>
</OnPlatform>
</Label.FontFamily>
</Label>
</StackLayout>
</Grid>
</ContentView>
<ContentView IsVisible="false" x:Name="TitleHM">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="9.5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Source="blue_circle.png" Grid.Column="0" />
<StackLayout Padding="0,4,0,5" VerticalOptions="Fill" Grid.Column="1">
<Label VerticalOptions="CenterAndExpand" TextColor="#0368b1" Text="Histórico de módificaciones" FontSize="20">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<OnPlatform.iOS>FrutigerLTStd-Cn</OnPlatform.iOS>
<OnPlatform.Android>FrutigerLTStd-Cn.otf#FrutigerLTStd-Cn</OnPlatform.Android>
</OnPlatform>
</Label.FontFamily>
</Label>
</StackLayout>
</Grid>
</ContentView>
<Grid VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentView x:Name="contentListView" IsVisible="true" Padding="0,10,0,0" BackgroundColor="White" Grid.Row="0">
<ListView x:Name="resultListView" BackgroundColor="White" HasUnevenRows="true" HorizontalOptions="FillAndExpand" SeparatorVisibility="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<StackLayout BackgroundColor="White" Padding="0" Opacity="90">
<ContentView Padding="1,0,1,1" BackgroundColor="Gray">
<Grid
BackgroundColor="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*">
</ColumnDefinition>
<ColumnDefinition Width="0.15*">
</ColumnDefinition>
<ColumnDefinition Width="0.15*">
</ColumnDefinition>
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0">
<Label Margin="-5" Text="{Binding NombreCompleto}" TextColor="Gray" Font="Bold,13" />
<Label Margin="-5"
Text="{Binding OrganizacionMayusculas}" TextColor="Gray" FontSize="13" />
<Label Margin="-5" Text="{Binding Region}" TextColor="Gray" FontSize="13" />
</StackLayout>
<Label Margin="0,0,0,2" Text="Detalle" Grid.Column="1"
Font="Bold, 13" ClassId="{Binding IdContacto}" TextColor="Gray" VerticalOptions="End">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" iOS="8">
<OnPlatform.iOS>FrutigerLTStd-BoldCn</OnPlatform.iOS>
<OnPlatform.Android>FrutigerLTStd-BoldCn.otf#FrutigerLTStd-BoldCn</OnPlatform.Android>
</OnPlatform>
</Label.FontFamily>
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="OnTapGestureRecognizerDetail" />
</Label.GestureRecognizers>
</Label>
<Label Margin="0,0,0,2" Text="Borrar" Grid.Column="2"
Font="Bold, 13" ClassId="{Binding IdContacto}" TextColor="Gray" VerticalOptions="End">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" iOS="8">
<OnPlatform.iOS>FrutigerLTStd-BoldCn</OnPlatform.iOS>
<OnPlatform.Android>FrutigerLTStd-BoldCn.otf#FrutigerLTStd-BoldCn</OnPlatform.Android>
</OnPlatform>
</Label.FontFamily>
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="OnTapGestureRecognizerDelete" />
</Label.GestureRecognizers>
</Label>
</Grid>
</ContentView>
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentView>
<StackLayout>
<extended:CustomButton Text="Volver" Grid.Row="1" x:Name="dismissbutton" Clicked="OnDismissButtonClicked" WidthRequest="100" Style="{StaticResource buttonStyle}" />
</StackLayout>
</Grid>
</StackLayout>
</ContentPage.Content>
</ContentPage>
The problem
Generally these sort of error you might find while working with data binding. While we are trying to bind a different type with some controls which the complier is not exactly expecting.
There are few places I could find the binding little odd -
ClassId="{Binding IdContacto}"
I am not sure whether you are binding correctly or not. If I were you I would have removed all the ClassId bindings and then go ahead with build compiling the process.
Also I would try to comment out the OnPlatform code and build/compile/Run the project.
These are some long shots which you may try. After looking at the whole Stacktrace may be we will be able to diagnose more towards the exact issue.

Resources