/// <summary> /// Set IsSelected flag for item /// </summary> /// <param name="current">Current item</param> private void setSelection(IElement current) { if ((ZoneViewModelTracks?.Count() ?? 0) > 0 && current != null) { foreach (IElement element in ZoneViewModelTracks) { if (element.Id == current.Id) { element.IsSelected = true; } else { element.IsSelected = false; } } } }
private async void onAVTransportURIMetaDataChanged(RaumFeldEvent args) { // val = "<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:raumfeld="urn:schemas-raumfeld-com:meta-data/raumfeld" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/" lang="en"><container parentID="0/My Music/Albums" id="0/My Music/Albums/The%20Notwist+12" restricted="1" childCount="9"><raumfeld:name>Album</raumfeld:name><upnp:class>object.container.album.musicAlbum</upnp:class><raumfeld:section>My Music</raumfeld:section><upnp:artist>The Notwist</upnp:artist><dc:date>1995</dc:date><upnp:album>12</upnp:album><upnp:albumArtURI dlna:profileID="JPEG_TN">http://192.168.0.18:47366/?albumArtist=The%20Notwist&amp;album=12</upnp:albumArtURI><raumfeld:totalPlaytime>0:39:07</raumfeld:totalPlaytime><dc:title>12</dc:title></container></DIDL-Lite>" /> if (args.ChangedValues.TryGetValue("val", out string avtransporturimetadata)) { DIDLLite didl = avtransporturimetadata.Deserialize <DIDLLite>(); if ((didl?.Containers?.Count() ?? 0) != 0) { if (await raumFeldService.BrowseChildren(ZoneViewModelTracks, didl.Containers?.First().Id, true)) { setSelection(CurrentTrackMetaData); } else { ZoneViewModelTracks.Clear(); } } } }