Class MediaQueryList
Namespace: Aspose.Html.Window
Assembly: Aspose.HTML.dll (25.2.0)
A MediaQueryList object stores information on a media query applied to a document, with support for both immediate and event-driven matching against the state of the document. See CSSOM View Module specification: https://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface
[DOMObject]
[DOMName("MediaQueryList")]
[ComVisible(true)]
public class MediaQueryList : EventTarget, INotifyPropertyChanged, IEventTarget, IDisposable
Inheritance
object ← DOMObject ← EventTarget ← MediaQueryList
Implements
INotifyPropertyChanged, IEventTarget, IDisposable
Inherited Members
EventTarget.AddEventListener(string, DOMEventHandler, bool), EventTarget.AddEventListener(string, IEventListener), EventTarget.AddEventListener(string, IEventListener, bool), EventTarget.RemoveEventListener(string, DOMEventHandler, bool), EventTarget.RemoveEventListener(string, IEventListener), EventTarget.RemoveEventListener(string, IEventListener, bool), EventTarget.DispatchEvent(Event), EventTarget.Dispose(), EventTarget.Dispose(bool), DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
Document
Context object’s associated document.
public Document Document { get; }
Property Value
Matches
A boolean value that returns true if the document currently matches the media query list, or false if not.
[DOMName("matches")]
public bool Matches { get; }
Property Value
Media
A string representing a serialized media query.
[DOMName("media")]
public string Media { get; }
Property Value
Methods
AddListener(IEventListener)
Add MediaQueryList matches state change event listener.
[DOMName("addListener")]
public void AddListener(IEventListener listener)
Parameters
listener
IEventListener
Takes an interface implemented by the user which contains the methods to be called when the event occurs.
RemoveListener(IEventListener)
Remove MediaQueryList matches state change event listener.
[DOMName("removeListener")]
public void RemoveListener(IEventListener listener)
Parameters
listener
IEventListener
The Aspose.Html.Dom.Events.IEventListener parameter indicates the Aspose.Html.Dom.Events.IEventListener to be removed.
OnChange
Event that is fired at the MediaQueryList when the matches state changes.
[DOMName("onchange")]
public event DOMEventHandler OnChange