在DataTemplate的Textblock中绑定ObservableList的items属性

时间:2017-06-17 18:56:15

标签: mvvm data-binding binding uwp

我想使用一些user A属性(艺术家,标题等)并将它们绑定在content X数据模板中。遗憾的是,exports.sendLikeNotification = likeRef.onWrite(event => { if (event.data.previous.exists()) { return; } var notificationId = event.params.likeNotificationId; var notificationRequest = event.data.val(); var receiverId = notificationRequest.receiverId; var message = notificationRequest.message var data = notificationRequest.data var topic = '/topics/user_' + receiverId; var payload = { notification: { body: message, sound: 'default' }, data: { data } }; var options = { priority: "high", contentAvailable: true }; // Send a message to devices subscribed to the provided topic. admin.messaging().sendToTopic(topic, payload, options) .then(function(response) { console.log("Successfully sent message:", response); return event.data.adminRef.remove(); }) .catch(function(error) { console.log("Error sending message:", error); }); }); 只能访问歌曲的元数据致电MediaPlaybackItem

在我的ListView中,我将绑定为Listbox的ItemSource可观察列表:

MediaPlaybackItem

然后我有了ListView数据模板:

MediaPlaybackItem.GetDisplayProperties().MusicProperties.Title;

我找不到将每个MediaPlaybackItem的属性(MediaPlaybackItems)绑定到 <ListView x:Name="SongList" HorizontalAlignment="Left" Visibility="Visible" Height="773" Background="{Binding}" Opacity="0.5" SelectedValue="selectedFile" ItemsSource="{Binding MediaModels.ListOfMediaPlaybackItems , Mode=TwoWay , UpdateSourceTrigger=PropertyChanged}" 的{​​{1}}的方法。 我希望你明白我的意思!非常感谢您的帮助!

祝你好运

1 个答案:

答案 0 :(得分:-1)

我从不使用mediaPlaybackItems,但会将您想要的每个属性加载到类中,如果我理解了您想要的内容,则将该类加载到observable集合中。如果您需要帮助,请告诉我。

相关问题