1

Having trouble understanding why MediaPlaybackList change notifications are not being sent to my ListView.

Code in Page View:

        <MediaPlayerElement x:Name="mediaPlayerElement"
                        Source="{Binding Path=DataContext.MediaPlaybackList, ElementName=PlayListControl, Mode=OneWay}"
                        AutoPlay="True"
                        AreTransportControlsEnabled="True"/>

Code in User Control:

                <ListView x:Name="PlayListView"
                      ItemsSource="{x:Bind ViewModel.MediaPlaybackList.Items, Mode=OneWay}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" />
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

Concerned that the "BackgroundMediaPlayback" sample seems to use a duplicate list for UI display purposes. Makes me think that you can't bind the UI to "MediaPlaybackList.Items". If so, I would like to ask why when it seems to be backed by an observable collection (IObservableVector). I am also interested in reasons why MicroSoft might not choose to support this --if that's the case.

user6189573
  • 43
  • 1
  • 6
  • Could you provide a simple reproducing sample to clarify your issue? How can I reproduce it? – Breeze Liu - MSFT Apr 16 '18 at 07:31
  • @Breeze Liu Thank you for your interest. I will try and produce a much simpler reproducible sample than what was in my uwp app. The problem revolved around adding **more** items to the MediaPlaybackList. The MediaPlayerElement knew about them but my ListView did not. Indicating no INPC or maybe the notifications are not making it to the UI thread? – user6189573 Apr 16 '18 at 19:12
  • Without the repro, I can not tell the reason, have you got the chance to create the simple repro? – Breeze Liu - MSFT May 09 '18 at 09:19

0 Answers0