UWP : ListView Grouping Source After changing at runtime UI is not Refreshing nor Updating because of static resource MVVM

Indudhar Gowda 426 Reputation points
2020-07-26T10:02:50.273+00:00

UWP : ListView Grouping Source After changing at runtime UI is not Refreshing nor Updating because of static resource MVVM

<Page.Resources>
<CollectionViewSource x:Name="PlayerSource" Source="{Binding Players}" IsSourceGrouped="true" />
</Page.Resources>

how-to-display-a-grouped-list-in-uwp-en.html

Please find the URL of the Source Code : https://damienaicheh.github.io/uwp/2018/07/23/how-to-display-a-grouped-list-in-uwp-en.html

Its Working Only Once, but even after my ObservableCollection changes at runtime its not updating the UI

Requirement : MVVM ObservableCollection OnPropertyChanged UI Should be Updated.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Peter Fleischer (former MVP) 19,231 Reputation points
    2020-07-26T16:29:24.463+00:00

    Hi,
    if you want update data item you cannot use x:Bind for binding.

    Try following changes if you want chenge the Number of Player:

    <TextBlock Grid.Column="1" Text="{Binding Number}" Style="{StaticResource NumberTextStyle}" />  
    

    For demo purposes you can use CollectionViewSource from Code and:

    <ListView ItemsSource="{Binding PlayerSource}">  
    

    13792-x.png

    See attached file.

    13737-x.txt

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Indudhar Gowda 426 Reputation points
    2020-07-27T17:34:44.623+00:00

    I tried its not Refreshing the UI ...I have attached the sample.

    https://1drv.ms/u/s!Ag8QU6ar3yRugYpzaotu8ymKyTl1bw?e=H9lsJT

    s!Ag8QU6ar3yRugYpzaotu8ymKyTl1bw

    13916-9.gif