Forum Xamarin.Forms

Custom controls not working in ListView.HeaderTemplate

JoshuaNovakJoshuaNovak USMember ✭✭
edited May 2015 in Xamarin.Forms

I have a list that has a custom control used in it, and it works great, but for some reason I can't use the control in the ListView.HeaderTemplate. I am passing in a Binding of ".", because if I don't pass anything in, it won't show the header. Anyone know how to get this to work?

My Code:

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="" xmlns:x="" xmlns:ctrls="clr-namespace:MyApp.Controls;assembly=MyApp" xmlns:local="clr-namespace:MyApp;assembly=MyApp" x:Class="MyApp.Views.HomePage" IsBusy="{Binding IsBusy}">
        <!--- Content -->
            <StackLayout Spacing="0" VerticalOptions="FillAndExpand">
                <!--- List -->
                <ListView ItemsSource="{Binding MyList}" SeparatorVisibility="None" IsPullToRefreshEnabled="true" RefreshCommand="{Binding RefreshMyListCommand}" IsRefreshing="{Binding IsRefreshing, Mode=OneWay}" ItemAppearing="OnItemAppearing" ItemSelected="OnItemSelected" RowHeight="100" Header="{Binding .}" BackgroundColor="Transparent">
                                <StackLayout Spacing="0" BackgroundColor="Transparent">
                                <ctrls:Shadow Direction="up" EndPoint="0.7" HeightRequest="80" Opacity="1" />
                                <Label Text="Test" />
                                        <ctrls:Shadow Direction="up" EndPoint="0.7" HeightRequest="80" Opacity="1" />
                                        <Label Text="Test" />
                <!--- /List -->
    <!--- /Content -->


Sign In or Register to comment.