Skip to content

Commit

Permalink
Finally got pull down to refresh to actually resort the CollectionView
Browse files Browse the repository at this point in the history
  • Loading branch information
Programming-With-Chris committed Jul 23, 2022
1 parent 88e350a commit 4647067
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ShoppingList/View/UserListDetails.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

<RefreshView Grid.ColumnSpan="3"
Command="{Binding RefreshUserListDetailScreenCommand}"
CommandParameter="UserListCollectionView"
IsRefreshing="{Binding IsRefreshing}">
<CollectionView ItemsSource="{Binding UserList.Items}"
CanReorderItems="True"
SelectionMode="None"
x:Name="UserListCollectionView">

<CollectionView.ItemTemplate >
<DataTemplate x:DataType="model:Item">
<Grid Padding="10"
Expand Down
5 changes: 3 additions & 2 deletions ShoppingList/ViewModel/UserListDetailViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void OnUserListChanged(UserList value)
public void RefreshUserListDetailScreen()
{

isRefreshing = true;
IsRefreshing = true;
UserList.Items.Clear();

UserList.Items = _itemService.GetUserListItems(UserList);
Expand All @@ -94,8 +94,9 @@ public void RefreshUserListDetailScreen()
Items.Add(item);
}

UserList = UserList;

isRefreshing = false;
IsRefreshing = false;
}

[RelayCommand]
Expand Down

0 comments on commit 4647067

Please sign in to comment.