AJAX Quickstarts   |   Silverlight Quickstarts   |   Dynamic Data Controls Quickstarts   |   Services Quickstarts   |   Dynamic Languages Quickstarts   |   ASP.NET AJAX Home   |      |  I want my samples in...     

Microsoft ASP.NET Futures: Quickstart Tutorial

ASP.NET Futures (July 2007): ASP.NET AJAX Client Script Reference for Silverlight

This section provides reference documentation for client-script APIs that were introduced in the ASP.NET Futures (May 2007) release to support working with the Media and Xaml controls in ASP.NET AJAX. There are modifications that have occurred in the Futures (July 2007) release, as documented in the Change List.

Sys.Preview.UI.Xaml.Control Class

Top

Provides the client base type for the Xaml server control.


Sys.Preview.UI.Xaml.Control Constructor

Top
Creates an instance of the Sys.Preview.UI.Xaml.Control class.
Sys.Preview.UI.Xaml.Control(domElement)

ParameterTypeDescription
domElement Object The DOM element to attach the client control to.

Return Value: None.


Sys.Preview.UI.Xaml.Control.add_xamlError Event
Sys.Preview.UI.Xaml.Control.remove_xamlError Event

Top
Adds or removes an event handler for the xamlError event. The event is raised if an error occurs when the XAML is loaded into the Silverlight host or if a run-time error occurs after loading.
Sys.Preview.UI.Xaml.Control.add_xamlError(handler)
Sys.Preview.UI.Xaml.Control.remove_xamlError(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Control.add_resize Event
Sys.Preview.UI.Xaml.Control.remove_resize Event

Top
Adds or removes an event handler for the resize event. The event is raised after the client control size has been changed.
Sys.Preview.UI.Xaml.Control.add_resize(handler)
Sys.Preview.UI.Xaml.Control.remove_resize(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Control.add_xamlInitialized Event
Sys.Preview.UI.Xaml.Control.remove_xamlInitialized Event

Top
Adds or removes an event handler for the xamlInitialized event. The event is raised after the XAML has been successfully loaded in the Silverlight host. Component developers use this event to bind event handlers and find XAML elements, typically by overriding xamlInitialize.
Sys.Preview.UI.Xaml.Control.add_xamlInitialized(handler)
Sys.Preview.UI.Xaml.Control.remove_xamlInitialized(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Control scaleMode Property

Top
Specifies how the XAML document should be scaled to fit within the Silverlight host.
Sys.Preview.UI.Xaml.Control.get_scaleMode()
Sys.Preview.UI.Xaml.Control.set_scaleMode(value)

ParameterTypeDescription
value Sys.Preview.UI.Xaml.ScaleMode The scale mode, (none, stretch, or zoom) for the XAML document.

Return Value: The Sys.Preview.UI.Xaml.ScaleMode value.


Sys.Preview.UI.Xaml.Control minimumSilverlightVersion Property

Top
Gets or sets a value that indicates the minimum Silverlight host version required for this XAML application.
Sys.Preview.UI.Xaml.Control.get_minimumSilverlightVersion()
Sys.Preview.UI.Xaml.Control.set_minimumSilverlightVersion(value)

ParameterTypeDescription
value String A value that represents the minimum Silverlight host version.

Return Value: A string that represents the minimum Silverlight host version.


Sys.Preview.UI.Xaml.Control xamlSource Property

Top
Gets or sets the URL to the XAML source file.

Note: The source cannot be modified after the client control has been initialized.

Sys.Preview.UI.Xaml.Control.get_xamlSource()
Sys.Preview.UI.Xaml.Control.set_xamlSource(value)

ParameterTypeDescription
value String The URL to the XAML source file.

Return Value: A string that contains the URL of the XAML source file.


Sys.Preview.UI.Xaml.Control addEventListener Method

Top
Adds an event handler to the specified event of a Xaml DOM element. The handler is automatically removed when the component is disposed.
Sys.Preview.UI.Xaml.Control.addEventListener(element, eventName, handler)

ParameterTypeDescription
element Object The XAML DOM element that exposes the event.
eventName String The name of the event. The event must be supported by the specified element.
handler Function The event handler to add.

Return Value: The Silverlight event listener token.


Sys.Preview.UI.Xaml.Control addEventListeners Method

Top
Adds a list of event handlers to a Xaml DOM element. The handlers are automatically removed when the component is disposed. If handlerOwner is specified, delegates are created for each event.
Sys.Preview.UI.Xaml.Control.addEventListener(element, events, handlerOwner)

ParameterTypeDescription
element Object The XAML DOM element that exposes the events.
events Object A dictionary of event handlers. The events must be supported by the specified element.
handlerOwner Object (Optional) The owner of the event handlers. Delegates are created for the events, and the handlerOwner object becomes the this pointer in the delegate.

Return Value: A list of Silverlight event listener tokens.


Sys.Preview.UI.Xaml.Control.dispose Method

Top
Called when the component is disposed or destroyed. If the component was initialized and the XAML associated with it was initialized, the dispose method ensures that the xamlDispose method is called. All events added through the addEventListener and addEventListeners methods are removed.
Sys.Preview.UI.Xaml.Control.dispose()

Return Value: None.


Sys.Preview.UI.Xaml.Control.initialize Method

Top
Called when the Sys.Preview.UI.Xaml.Control object is initialized. If the source property is defined for the control, the control attaches an event handler to the OnLoad event of the Silverlight host. When the event listener is called, the xamlInitialized event is raised.
Sys.Preview.UI.Xaml.Control.initialize()

Return Value: None.


Sys.Preview.UI.Xaml.Control.onResize Method

Top
Called when the size of the Silverlight host changes.
Sys.Preview.UI.Xaml.Control.onResize(args)

ParameterTypeDescription
args Sys.EventArgs Empty. The event arguments.

Return Value: None.


Sys.Preview.UI.Xaml.Control.onXamlError Method

Top
Called if a Silverlight error occurs.
Sys.Preview.UI.Xaml.Control.onXamlError(args)

ParameterTypeDescription
args Sys.Preview.UI.Xaml.ErrorEventArgs The event arguments that contain the message details for the error.

Return Value: None.


Sys.Preview.UI.Xaml.Control.xamlDispose Method

Top
Called when the component is disposed and a XAML document had been initialized. Component developers typically override this method in derived components.
Sys.Preview.UI.Xaml.Control.xamlDispose()

Return Value: None.


Sys.Preview.UI.Xaml.Control.xamlInitialize Method

Top
Called when the specified XAML source has been loaded. Component developers typically override this method in derived components to attach event listeners to Xaml Dom elements.
Sys.Preview.UI.Xaml.Control.xamlInitialize()

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player Class

Top

Provides the client base type for the Media server control.


Sys.Preview.UI.Xaml.Media.Player Constructor

Top
Creates an instance of the Sys.Preview.UI.Xaml.Media.Player class.
Sys.Preview.UI.Xaml.Media.Player(domElement)

ParameterTypeDescription
domElement Object The DOM element to attach the client control to.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player chapterStarted Method

Top
Adds or removes an event handler for the chapterStarted event. The event is raised when the beginning of a chapter is reached and the chapter begins.
Sys.Preview.UI.Xaml.Media.Player.add_chapterStarted(handler)
Sys.Preview.UI.Xaml.Media.Player.remove_chapterStarted(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player markerReached Method

Top
Adds or removes an event handler for the markerReached event. The event is raised when a marker is reached. Markers include regular markers, script commands, and chapters.
Sys.Preview.UI.Xaml.Media.Player.add_markerReached(handler)
Sys.Preview.UI.Xaml.Media.Player.remove_markerReached(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player mediaEnded Method

Top
Adds or removes an event handler for the mediaEnded event. The event is raised when the currently playing media ends. This event might be raised multiple times if the source refers to a client playlist. The event is also raised if the user skips or seeks past the end of the currently playing media.
Sys.Preview.UI.Xaml.Media.Player.add_mediaEnded(handler)
Sys.Preview.UI.Xaml.Media.Player.remove_mediaEnded(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player mediaFailed Method

Top
Adds or removes an event handler for the mediaFailed event. The event is raised if an error occurs, such as while loading the media.
Sys.Preview.UI.Xaml.Media.Player.add_mediaFailed(handler)
Sys.Preview.UI.Xaml.Media.Player.remove_mediaFailed(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player mediaOpened Method

Top
Adds or removes an event handler for the mediaOpened event. The event is raised when the media is opened.
Sys.Preview.UI.Xaml.Media.Player.add_mediaOpened(handler)
Sys.Preview.UI.Xaml.Media.Player.remove_mediaOpened(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player stateChanged Method

Top
Adds or removes an event handler for the stateChanged event. The event is raised when the media starts playing, pauses, or stops.
Sys.Preview.UI.Xaml.Media.Player.add_stateChanged(handler)
Sys.Preview.UI.Xaml.Media.Player.remove_stateChanged(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player volumeChanged Method

Top
Adds or removes an event handler for the volumeChanged event. The event is raised when the volume on the media is modified.
Sys.Preview.UI.Xaml.Media.Player.add_volumeChanged(handler)
Sys.Preview.UI.Xaml.Media.Player.remove_volumeChanged(handler)

ParameterTypeDescription
handler Function The event handler to add or remove.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player autoPlay Property

Top
Gets or sets a value that indicates whether the media plays immediately after the XAML is opened and the media opened.
Sys.Preview.UI.Xaml.Media.Player.get_autoPlay()
Sys.Preview.UI.Xaml.Media.Player.set_autoPlay(value)

ParameterTypeDescription
value Boolean true to specify that the media plays as soon as it can after being opened and after the XAML has been loaded; otherwise, false.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player caption Property

Top
Gets or sets the current caption string. If the XAML defines a caption area (and therefore supports captions), the caption is displayed. Captions are removed if another caption is defined, if the media ends, or if an empty caption is received.
Sys.Preview.UI.Xaml.Media.Player.get_caption()
Sys.Preview.UI.Xaml.Media.Player.set_caption(value)

ParameterTypeDescription
value String The caption value.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player chapters Property

Top
Gets or sets the chapter array. A chapter is defined with time, title, and imageUrl members.
Sys.Preview.UI.Xaml.Media.Player.get_chapters()
Sys.Preview.UI.Xaml.Media.Player.set_chapters(value)

ParameterTypeDescription
value Array The chapters.

Return Value: Array.


Sys.Preview.UI.Xaml.Media.Player currentChapter Property

Top
Gets or sets the current chapter by index.
Sys.Preview.UI.Xaml.Media.Player.get_currentChapter()
Sys.Preview.UI.Xaml.Media.Player.set_currentChapter(value)

ParameterTypeDescription
value Number The current chapter index.

Return Value: Array.


Sys.Preview.UI.Xaml.Media.Player enableCaptions Property

Top
Gets or sets a value that indicates whether captions that are embedded in the media should be. displayed. Captions are displayed only if the XAML defined by the media control's MediaSkin property supports captions.
Sys.Preview.UI.Xaml.Media.Player.get_enableCaptions()
Sys.Preview.UI.Xaml.Media.Player.set_enableCaptions(value)

ParameterTypeDescription
value Boolean true to enable captions; otherwise, false.

Return Value: Boolean.


Sys.Preview.UI.Xaml.Media.Player mediaMarkers Property

Top
Gets an Array of Silverlight media markers that exist in the currently loaded media.
Sys.Preview.UI.Xaml.Media.Player.get_mediaMarkers()

ParameterTypeDescription
value Array The markers array.

Return Value: Array.


Sys.Preview.UI.Xaml.Media.Player mediaElement Property

Top
Gets the MediaElement DOM element in the XAML that is currently loaded.
Sys.Preview.UI.Xaml.Media.Player.get_mediaElement()

Return Value: Object.


Sys.Preview.UI.Xaml.Media.Player mediaUrl Property

Top
Gets or sets the media source defined by the media URL.
Sys.Preview.UI.Xaml.Media.Player.get_mediaUrl()
Sys.Preview.UI.Xaml.Media.Player.set_mediaUrl(value)

ParameterTypeDescription
value String The URL to the media source.

Return Value: String.


Sys.Preview.UI.Xaml.Media.Player muted Property

Top
Gets or sets a value that indicates whether the media should be muted.
Sys.Preview.UI.Xaml.Media.Player.get_muted()
Sys.Preview.UI.Xaml.Media.Player.set_muted(value)

ParameterTypeDescription
value Boolean true to mute the media; otherwise, false.

Return Value: Boolean.


Sys.Preview.UI.Xaml.Media.Player placeholderImage Property

Top
Gets or sets the URL to the placeholder image that is displayed before the media is able to play.
Sys.Preview.UI.Xaml.Media.Player.get_placeholderImage()
Sys.Preview.UI.Xaml.Media.Player.set_placeholderImage(value)

ParameterTypeDescription
value String The URL to the placeholder image.

Return Value: String.


Sys.Preview.UI.Xaml.Media.Player playState Property

Top
Gets the play state of the media being played.
Sys.Preview.UI.Xaml.Media.Player.get_playState()

Return Value: String.


Sys.Preview.UI.Xaml.Media.Player timeIndex Property

Top
Gets or sets the playback time of the media being played.
Sys.Preview.UI.Xaml.Media.Player.get_timeIndex()
Sys.Preview.UI.Xaml.Media.Player.set_timeIndex(value)

ParameterTypeDescription
value Number The play back time of the media.

Return Value: Number.


Sys.Preview.UI.Xaml.Media.Player volume Property

Top
Gets or sets the volume of the media being played. Volume levels are defined between 0 and 1.
Sys.Preview.UI.Xaml.Media.Player.get_volume()
Sys.Preview.UI.Xaml.Media.Player.set_volume(value)

ParameterTypeDescription
value Number The volume level of the media.

Return Value: Number.


Sys.Preview.UI.Xaml.Media.Player nextChapter Method

Top
Advances the media to the next chapter in the chapters array.
Sys.Preview.UI.Xaml.Media.Player.nextChapter()

Return Value: true if the media could be advanced; otherwise, false.


Sys.Preview.UI.Xaml.Media.Player onChapterStarted Method

Top
Called when a chapter starts in the media being played.
Sys.Preview.UI.Xaml.Media.Player.onChapterStarted(chapterEventArgs)

ParameterTypeDescription
chapterEventArgs Sys.Preview.UI.Xaml.Media.ChapterEventArgs Information about the chapter that was started.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player onMarkerReached Method

Top
Called when a marker embedded in the media file has been reached.
Sys.Preview.UI.Xaml.Media.Player.onMarkerReached(markerEventArgs)

ParameterTypeDescription
markerEventArgs Sys.Preview.UI.Xaml.Media.MarkerEventArgs Information about the marker that was reached.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player onPlayStateChanged Method

Top
Called when the state of the currently opened media changes.
Sys.Preview.UI.Xaml.Media.Player.onPlayStateChanged(stateChangedEventArgs)

ParameterTypeDescription
stateChangedEventArgs Sys.Preview.UI.Xaml.Media.StateChangedEventArgs Information about the current and previous state of the media.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player onVolumeChanged Method

Top
Called when the volume level changes.
Sys.Preview.UI.Xaml.Media.Player.onVolumeChanged(args)

ParameterTypeDescription
args Sys.EventArgs Empty.

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player pause Method

Top
Pauses the currently playing media.
Sys.Preview.UI.Xaml.Media.Player.pause()

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player play Method

Top
Starts playing the current media from the current position in the media.
Sys.Preview.UI.Xaml.Media.Player.play()

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player stop Method

Top
Stops playing the current media.
Sys.Preview.UI.Xaml.Media.Player.stop()

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player previousChapter Method

Top
Skips to the previous chapter in the chapter array.
Sys.Preview.UI.Xaml.Media.Player.previousChapter()

Return Value: true if the chapter could be changed; otherwise, false.


Sys.Preview.UI.Xaml.Media.Player toggleMuted Method

Top
Toggles the muted state on the media.
Sys.Preview.UI.Xaml.Media.Player.toggleMuted()

Return Value: Boolean: true if the media is muted; otherwise, false.


Sys.Preview.UI.Xaml.Media.Player togglePlayPause Method

Top
Toggles the media between playing and paused.
Sys.Preview.UI.Xaml.Media.Player.togglePlayPause()

Return Value: A string that contains the new play state.


Sys.Preview.UI.Xaml.Media.Player xmlDispose Method

Top
Inherited from Sys.Preview.UI.Xaml.Control.
Sys.Preview.UI.Xaml.Media.Player.xmlDispose()

Return Value: None.


Sys.Preview.UI.Xaml.Media.Player xmlInitialize Method

Top
Inherited from Sys.Preview.UI.Xaml.Control.
Sys.Preview.UI.Xaml.Media.Player.xmlInitialize()

Return Value: None.


Sys.Preview.UI.Xaml.ErrorEventArgs Class

Top

Provides event arguments for the Xaml control error event.


Sys.Preview.UI.Xaml.Media.ErrorEventArgs constructor Method

Top
Initializes a new instance of the error event arguments.
Sys.Preview.UI.Xaml.ErrorEventArgs(xamlError)

ParameterTypeDescription
xamlError Object The Silverlight error object.

Return Value: None.


Sys.Preview.UI.Xaml.Media.ErrorEventArgs error Property

Top
Gets the Silverlight error object.
Sys.Preview.UI.Xaml.Media.ErrorEventArgs.get_error()

Return Value: The error object.


Sys.Preview.UI.Xaml.Media.ChapterEventArgs Class

Top

Provides event arguments for the Xaml control chapter-changed event.


Sys.Preview.UI.Xaml.Media.ChapterEventArgs constructor Method

Top
Initializes a new instance of the event arguments for the chapter-changed event.
Sys.Preview.UI.Xaml.Media.ChapterEventArgs(chapterIndex)

ParameterTypeDescription
chapterIndex Number The chapter index.

Return Value: None.


Sys.Preview.UI.Xaml.Media.ChapterEventArgs chapterIndex Property

Top
Gets the chapter index.
Sys.Preview.UI.Xaml.Media.ChapterEventArgs.get_chapterIndex()

Return Value: The chapter index number.


Sys.Preview.UI.Xaml.Media.MarkerEventArgs Class

Top

Provides event arguments for the Xaml control's marker-reached event.


Sys.Preview.UI.Xaml.Media.MarkerEventArgs constructor Method

Top
Initializes a new instance of the arguments for the marker-reached event.
Sys.Preview.UI.Xaml.Media.MarkerEventArgs(marker)

ParameterTypeDescription
marker String The Silverlight marker.

Return Value: None.


Sys.Preview.UI.Xaml.Media.MarkerEventArgs marker Property

Top
Gets the marker.
Sys.Preview.UI.Xaml.Media.MarkerEventArgs.get_marker()

Return Value: The Silverlight MediaMarker instance.


Sys.Preview.UI.Xaml.Media.StateChangedEventArgs Class

Top

Provides information for the Xaml control's state-changed event.


Sys.Preview.UI.Xaml.Media.StateChangedEventArgs constructor Method

Top
Initializes a new instance of the arguments for the marker-reached event.
Sys.Preview.UI.Xaml.Media.StateChangedEventArgs(propertyName, previousState, currentState)

ParameterTypeDescription
propertyName String The name of the property that changed
previousState String The previous state.
currentState String The current state.

Return Value: None.


Sys.Preview.UI.Xaml.Media.StateChangedEventArgs currentState Property

Top
Gets the current state of the media.
Sys.Preview.UI.Xaml.Media.StateChangedEventArgs.get_currentState()

Return Value: A string that contains the current state, if defined; otherwise, null.


Sys.Preview.UI.Xaml.Media.StateChangedEventArgs previousState Property

Top
Gets the previous state of the media.
Sys.Preview.UI.Xaml.Media.StateChangedEventArgs.get_previousState()

Return Value: A string that contains the previous state, if defined; otherwise, null.


Sys.Preview.UI.Xaml.ScaleMode Enum

Top

The visibility mode of a XAML DOM element. Values are none, zoom, and stretch.



This topic is Microsoft ASP.NET Futures pre-release documentation and is unsupported by Microsoft. Blank topics are included as placeholders and existing content is subject to change in future releases.