コード例 #1
0
 /// <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;
             }
         }
     }
 }
コード例 #2
0
 private async void onAVTransportURIMetaDataChanged(RaumFeldEvent args)
 {
     // val = "&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:raumfeld=&quot;urn:schemas-raumfeld-com:meta-data/raumfeld&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:dlna=&quot;urn:schemas-dlna-org:metadata-1-0/&quot; lang=&quot;en&quot;&gt;&lt;container parentID=&quot;0/My Music/Albums&quot; id=&quot;0/My Music/Albums/The%20Notwist+12&quot; restricted=&quot;1&quot; childCount=&quot;9&quot;&gt;&lt;raumfeld:name&gt;Album&lt;/raumfeld:name&gt;&lt;upnp:class&gt;object.container.album.musicAlbum&lt;/upnp:class&gt;&lt;raumfeld:section&gt;My Music&lt;/raumfeld:section&gt;&lt;upnp:artist&gt;The Notwist&lt;/upnp:artist&gt;&lt;dc:date&gt;1995&lt;/dc:date&gt;&lt;upnp:album&gt;12&lt;/upnp:album&gt;&lt;upnp:albumArtURI dlna:profileID=&quot;JPEG_TN&quot;&gt;http://192.168.0.18:47366/?albumArtist=The%20Notwist&amp;amp;album=12&lt;/upnp:albumArtURI&gt;&lt;raumfeld:totalPlaytime&gt;0:39:07&lt;/raumfeld:totalPlaytime&gt;&lt;dc:title&gt;12&lt;/dc:title&gt;&lt;/container&gt;&lt;/DIDL-Lite&gt;" />
     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();
             }
         }
     }
 }