这个模板以HeaderHeight作为绑定参数。如果在调用模板的XAML中没有指定HeaderHeight,有没有办法让StackLayout忽略它呢?
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:Japanese;assembly=Japanese" x:Class="Japanese.Templates.HeaderTemplate" x:Name="this">
<ContentView.Triggers>
<Trigger TargetType="local:Templates.HeaderTemplate" Property="HeaderType" Value="Custom">
<Setter Property="Content">
<Setter.Value>
<StackLayout HorizontalOptions="FillAndExpand" Orientation="Vertical" Spacing="0" Margin="0">
<StackLayout HeightRequest="{Binding HeaderHeight, Source={x:Reference this}}" Orientation="Vertical" Spacing="0" Margin="0" >
<Label Text="ABC" HorizontalOptions="Start" VerticalOptions="EndAndExpand" />
</StackLayout>
</StackLayout>
</Setter.Value>
</Setter>
</Trigger>
</ContentView.Triggers>
</ContentView>