MPMediaQuerySection Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A subset of the values returned by a MPMediaQuery, as specified by the ItemSections or CollectionSections properties.
[Foundation.Register("MPMediaQuerySection", true)]
public class MPMediaQuerySection : Foundation.NSObject, Foundation.INSCopying, Foundation.INSSecureCoding, IDisposable
[<Foundation.Register("MPMediaQuerySection", true)>]
type MPMediaQuerySection = class
inherit NSObject
interface INSCoding
interface INativeObject
interface IDisposable
interface INSCopying
interface INSSecureCoding
- Inheritance
- Attributes
- Implements
Remarks
MPMediaQuerySections represent a subset of results of a MPMediaQuery. You can control the grouping by specifying the GroupingType as shown in the following example, which outputs the songs from albums whose title's start with the letter 'S':
var mq = new MPMediaQuery();
mq.GroupingType = MPMediaGrouping.Album;
var value = NSNumber.FromInt32((int)MPMediaType.Music);
var predicate = MPMediaPropertyPredicate.PredicateWithValue(value, MPMediaItem.MediaTypeProperty);
mq.AddFilterPredicate(predicate);
var items = mq.Items;
var secs = mq.ItemSections;
if(secs != null)
{
var songsFromSAlbums =
from sSection in
from sec in secs where sec.Title == "S" select sec
from song in items.Skip(sSection.Range.Location).Take(sSection.Range.Length) select song;
foreach(var song in songsFromSAlbums)
{
Console.WriteLine(song.Title + ": " + song.AlbumTitle);
}
}
Constructors
| Name | Description |
|---|---|
| MPMediaQuerySection(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| MPMediaQuerySection(NSCoder) |
A constructor that initializes the object from the data stored in the unarchiver object. |
| MPMediaQuerySection(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
Properties
| Name | Description |
|---|---|
| AccessibilityAttributedUserInputLabels | (Inherited from NSObject) |
| AccessibilityRespondsToUserInteraction | (Inherited from NSObject) |
| AccessibilityTextualContext | (Inherited from NSObject) |
| AccessibilityUserInputLabels | (Inherited from NSObject) |
| Class | (Inherited from NSObject) |
| ClassHandle |
The Objective-C class handle for this class. |
| DebugDescription | (Inherited from NSObject) |
| Description | (Inherited from NSObject) |
| Handle |
Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) |
| IsDirectBinding | (Inherited from NSObject) |
| IsProxy | (Inherited from NSObject) |
| Range |
The ___location and length, inside the originating MPMediaQuery, of this section. |
| RetainCount | (Inherited from NSObject) |
| Self | (Inherited from NSObject) |
| Superclass | (Inherited from NSObject) |
| SuperHandle |
Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) |
| Title |
The identifier of this section. |
| Zone | (Inherited from NSObject) |