<Canvas
Width='24' Height='24'
x:Name='canvasPause'
MouseEnter='PauseButtonMouseEnter'
MouseLeave='PauseButtonMouseLeave'
Opacity='0'>
<Rectangle
Width='24' Height='24'
Fill='#FFFFFFFF'
Stroke='#FF000000'
RadiusX='3' RadiusY='3'
x:Name='RectPause' StrokeThickness='2'/>
<Rectangle
Width='6' Height='14'
Fill='#FF141414'
Stroke='#FF000000'
Canvas.Left='13' Canvas.Top='5'
x:Name='rectPauseBar1'/>
<Rectangle
Width='6' Height='14'
Fill='#FF141414'
Stroke='#FF000000'
Canvas.Left='5' Canvas.Top='5'
x:Name='rectPauseBar2'/>
</Canvas>
</Canvas>
<Canvas
Width='255' Height='27'
Canvas.Left='36' Canvas.Top='346'
x:Name='canvasProgress'>
<Rectangle
Width='244' Height='8'
Fill='#FF414141' Stroke='#FF000000'
Canvas.Top='10'
x:Name='rectProgressWell'
Canvas.Left='8.5'/>
<Rectangle
Width='3' Height='8'
Fill='#FF9D0808' Stroke='#FF000000'
Canvas.Top='10'
x:Name='rectDownloadProgress'
StrokeThickness='0' Canvas.Left='8.5'/>
<Ellipse
Width='16' Height='16'
Stroke='#FF000000'
Canvas.Top='6' Canvas.Left='0'
x:Name='ellMarker'>
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color='#FF000000' Offset='0'/>
<GradientStop Color='#FFF6F6EC' Offset='1'/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Canvas>
<TextBlock
Width='148' Height='21'
Text='TextBlock' TextWrapping='Wrap'
Canvas.Left='321' Canvas.Top='348'
x:Name='TextBlock'/>
</Canvas>
With the UI created and ready for coding, you're ready to wire up all the controls so that they will function as one. You'll define the event handlers in the following table.
Event Handler | Description |
---|---|
DownloadProgressChanged() | Continuously invoked when the MediaElement control downloads the media from the remote server. It is used to update the red progress bar indicating the progress of the download. |
EllMarkerMouseDown() | Invoked when the user clicks on the marker using the left mouse button. |
EllMarkerMouseUp() | Invoked when the user releases the left mouse button. |
MediaPlayerMouseMove() | Invoked when the mouse moves across the Silverlight page. |
MediaPlayerMouseLeave() | Invoked when the mouse leaves the Silverlight page. |
MediaEnded() | Invoked when the media has finished playing. The media will be reset to its starting position (so is the marker). |
PlayPauseButtonUp() | Invoked when the user clicks on the Play/Pause button. |