【发布时间】:2016-07-04 16:03:32
【问题描述】:
这是页脚的 XAML 代码:
<ListView.FooterTemplate IsVisible="{Binding IsLoading}">
<DataTemplate>
<StackLayout Padding="8">
<Label Text ="Loading ..."
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand"/>
<ActivityIndicator IsRunning="{Binding IsLoading}"
Color="Blue"
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand"/>
</StackLayout>
</DataTemplate>
</ListView.FooterTemplate>
ActivityIndicator 正在按预期工作(当IsLoading 设置为false 时它会停止)。但是一旦IsLoading 设置为false,我想让整个页脚消失,我无法做到这一点。
【问题讨论】:
-
尝试传递一个可以为空的IsLoading,一旦加载,设置为null
-
@AkashKava 在执行
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));时会抛出System.NullReferenceException: Object reference not set to an instance of an object.(就在IsLoading设置为null时)。