How to properly set height on GRID? - xamarin

I trying to create a UI something just like this (as a reference).
but I am having a trouble to get the design. I used grid but I keep getting this result. I set the Grid row definitions to 80* and 20* and still not getting the result I wanted. My idea is the design to be in percentage rather that set a specific height. If I can't use percentage is there a way to make my UI responsive for different screen size and orientation? Is there a way I can achieve this?
Here is my XAML Code:
<ContentPage.Content>
<ScrollView>
<StackLayout Spacing="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" Grid.Column="0" StyleClass="start" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<StackLayout VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Label StyleClass="brand" Text="TBS">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Black.ttf#SFProDisplay-Black"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<Label StyleClass="startpagetitle" Text="TBS Point of Sale">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Light.ttf#SFProDisplay-Light"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<Label StyleClass="startpagesubtitle" Text="Run and grow your business.">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Light.ttf#SFProDisplay-Light"/>
</OnPlatform>
</Label.FontFamily>
</Label>
</StackLayout>
</StackLayout>
<StackLayout Grid.Row="1" Grid.Column="0" BackgroundColor="White" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Button StyleClass="btn" Text="Login" x:Name="btnLogin">
<Button.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Regular.ttf#SFProDisplay-Regular"/>
</OnPlatform>
</Button.FontFamily>
</Button>
</StackLayout>
</Grid>
</StackLayout>
</ScrollView>
</ContentPage.Content>

Remove the StackLayout outside of your content Grid. The Grid won't take the whole space of the StackLayout so that it looks the percentage is wrong:
<ScrollView>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80*"/>
<RowDefinition Height="20*"/>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" Grid.Column="0" StyleClass="start" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<StackLayout VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Label StyleClass="brand" Text="TBS">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Black.ttf#SFProDisplay-Black"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<Label StyleClass="startpagetitle" Text="TBS Point of Sale">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Light.ttf#SFProDisplay-Light"/>
</OnPlatform>
</Label.FontFamily>
</Label>
<Label StyleClass="startpagesubtitle" Text="Run and grow your business.">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Light.ttf#SFProDisplay-Light"/>
</OnPlatform>
</Label.FontFamily>
</Label>
</StackLayout>
</StackLayout>
<StackLayout Grid.Row="1" Grid.Column="0" BackgroundColor="White" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Button StyleClass="btn" Text="Login" x:Name="btnLogin">
<Button.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFProDisplay-Regular.ttf#SFProDisplay-Regular"/>
</OnPlatform>
</Button.FontFamily>
</Button>
</StackLayout>
</Grid>
</ScrollView>
Moreover, I think the scroll view can be removed too if you don't want your screen to scroll.
Or you can try to add <Grid VerticalOptions="FillAndExpand"> to make your Grid fill full of the StackLayout.

Related

Xamarin Grid Height changes after Images Loaded

As i shows in attached images, my grid row is square shaped space before connecting to server and load the images, but when images are loaded it changes it's height and become rectangle shape. how can i avoid it ? i want to keep the square shaped space.
my photos are also squared.
before and after after connecting to server
[1]: https://i.stack.imgur.com/lZj6F.png
[2]: https://i.stack.imgur.com/ZaKQd.png
Code :
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Image x:Name="imgStation1" Grid.Row="0" Grid.Column="0" BackgroundColor="White" Source="saturday.jpg" Aspect="AspectFill" />
<StackLayout Grid.Row="0" Grid.Column="0" VerticalOptions="StartAndExpand" Spacing="10" Margin="10">
<Label x:Name="lblLiveStation1" Text="" FontSize="Small" TextColor="AntiqueWhite">
<Label.FontFamily>
<OnPlatform
x:TypeArguments="x:String"
Android="gothic.ttf#gothic"
iOS="Optima-Regular" />
</Label.FontFamily>
</Label>
<Label x:Name="lblDescriptionStation1" Text="Loading..." FontSize="Medium" FontAttributes="Bold" TextColor="FloralWhite">
<Label.FontFamily>
<OnPlatform
x:TypeArguments="x:String"
Android="gothic.ttf#gothic"
iOS="Optima-Regular" />
</Label.FontFamily>
</Label>
<Label x:Name="lblTimeStation1" Text="" FontSize="Small" FontAttributes="Bold" TextColor="GhostWhite">
<Label.FontFamily>
<OnPlatform
x:TypeArguments="x:String"
Android="gothic.ttf#gothic"
iOS="Optima-Regular" />
</Label.FontFamily>
</Label>
<ImageButton x:Name="imgPlayPause0" Grid.Row="0" VerticalOptions="End" HorizontalOptions="Start" Source="playlogo.png" BackgroundColor="Transparent" Clicked="imgPlayPause0_Clicked"></ImageButton>
</StackLayout>
</StackLayout>
Have you tried giving Aspect="Fill" ?
If you want to have image with height = width(i.e., Square), then give hardcoded width or height to it.
If that is not possible in your case, then try using RelativeSource where WidthHeight ="*" and height will be relative to Width like this WidthRequest="{Binding Source={x:Reference Self}, Path=WidthRequest}}"

Xamarin MVVM Custom Font Not Working In Data Template

Having trouble with using a font. Works fine when I to the following down below.
FontFamily="{StaticResource IconFonts}" Text=""
But it doesn't work if I try to dynamically bind the text property.
FontFamily="{StaticResource IconFonts}" Text="{Binding Comments}"
It shows up all weird. It looks like it tries to do something but doesn't completely render. Here is the full code with my testing included down below. Thanks in advance.
<FlexLayout x:Name="FlexFood"
Wrap="Wrap"
Direction="Row"
JustifyContent="Start"
Padding="0, 10"
BindableLayout.ItemsSource="{Binding FoodCollection}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<StackLayout Padding="5, 0">
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="OnTypesSelected"></TapGestureRecognizer>
</Frame.GestureRecognizers>
<Frame.Content>
<StackLayout x:Name="LayoutFood">
<StackLayout VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
<Label x:Name="LabelTitle" Padding="0, 10">
<Label.FormattedText>
<FormattedString>
<Span FontSize="Subtitle" Text="{Binding Title}" FontAttributes="Bold"></Span>
<Span Text=" "></Span>
<Span FontSize="Subtitle" Text="{Binding Version}" FontAttributes="Bold"></Span>
</FormattedString>
</Label.FormattedText>
</Label>
</StackLayout>
<StackLayout Orientation="Horizontal">
<StackLayout HorizontalOptions="StartAndExpand">
<Label Text="{Binding Description}" FontSize="Body"></Label>-->
<Label FontSize="Caption" TextColor="#LELELE">
<Label.FormattedText>
<FormattedString>
<Span Text="{Binding fDepartment}"></Span>
<Span Text="{Binding pType}"></Span>
</FormattedString>
</Label.FormattedText>
</Label>
</StackLayout>
<StackLayout HorizontalOptions="End">
<Label Text="{Binding Comments}"></Label>
<Label FontFamily="{StaticResource IconFonts}" Text=""></Label>
<Label x:Name="LabelTypeTest" FontFamily="{StaticResource IconFonts}"
Text="{Binding Comments, StringFormat=''}"></Label>
<Label FontFamily="{StaticResource IconFonts}" Text="{Binding Comments}"></Label>
<Image x:Name="ImageTypeTest">
<Image.Source>
<FontImageSource Size="48" FontFamily="{StaticResource IconFonts}" Color="#000000"></FontImageSource>
</Image.Source>
</Image>
</StackLayout>
</StackLayout>
</StackLayout>
</Frame.Content>
</helper:LayoutGradient>
</StackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
Here is the static resource in app
<ResourceDictionary>
<OnPlatform x:Key="IconFonts" x:TypeArguments="x:String">
<On Platform="iOS" Value="Material Design Icons"></On>
<On Platform="Android" Value="IconFonts.ttf#Material Design Icons"></On>
<On Platform="UWP" Value="/Assets/IconFonts.ttf#Material Design Icons"></On>
</OnPlatform>
</ResourceDictionary>
You should return the escape sequence of \uf139 from your binding instead of 
You can read the Access from Bindings and Access Directly in XAML section in the source link for more information.
Refer: xamarin-forms-fontawesome-doesnt-work-with-bound-properties

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>

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