I have added a RefreshView
for a CollectionView
. After adding RefreshView
, the CollectionView
contents are not visible on the UI. The CollectionView
contents are visible on the UI before adding RefreshView
. Below is the code:
<RefreshView
IsRefreshing="{Binding IsRefreshing}"
Command="{Binding RefreshCommand}">
<CollectionView
x:Name="MyTweetsList"
ItemsSource="{Binding AllItems,Mode=TwoWay}"
RemainingItemsThreshold="0"
RemainingItemsThresholdReached="LoadMoreTweets"
HorizontalOptions="Fill">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand"
Orientation="Vertical">
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>
public ICommand RefreshCommand
{
get
{
return new Command(async () =>
{
IsRefreshing = true;
LoadData();
IsRefreshing = false;
});
}
}
private bool _isRefreshing = false;
public bool IsRefreshing
{
get { return _isRefreshing; }
set
{
_isRefreshing = value;
OnPropertyChanged(nameof(IsRefreshing));
}
}
Do I need to add anything else to view the data on UI when adding RefreshView
?