can I call an event handler here

Apr 15, 2011 at 7:20 PM

Hi.

I am trying to call a function in the xaml portion of my solution.

I am also a newbie to this kind of programming so bear with me.

<smf:SMFPlayer x:Name="player" Grid.Row="2" AutoPlay="False" MediaEnded="player_MediaEnded" Style="{StaticResource sw_player}">
            <smf:SMFPlayer.Playlist>
                <media:PlaylistItem
                    StartPosition=""
                    DeliveryMethod="AdaptiveStreaming"
                    SelectedCaptionStreamName="textstream_eng"
                    MediaSource="http://some-stream.com/video.ism/Manifest" />
            </smf:SMFPlayer.Playlist>
        </smf:SMFPlayer>

I am trying to put an event handler at StartPosition and eventually MediaSource.

How would I do this as VS is not letting me do it.

Thanks in advance

<smf:SMFPlayer x:Name="player" Grid.Row="2" AutoPlay="False" MediaEnded="player_MediaEnded" Style="{StaticResource sw_player}">
            <smf:SMFPlayer.Playlist>
                <media:PlaylistItem
                    Title=""
                    StartPosition=""
                    DeliveryMethod="AdaptiveStreaming"
                    SelectedCaptionStreamName="textstream_eng"
                    MediaSource="http://lab.integrated-digital.com:61010/SmoothStreamingEncodes/Astroboy_SmoothStreaming_MultiAudio/Astroboy_SmoothStreaming_MultiAudio.ism/Manifest" />
            </smf:SMFPlayer.Playlist>
        </smf:SMFPlayer>
<smf:SMFPlayer x:Name="player" Grid.Row="2" AutoPlay="False" MediaEnded="player_MediaEnded" Style="{StaticResource sw_player}">
            <smf:SMFPlayer.Playlist>
                <media:PlaylistItem
                    Title=""
                    StartPosition=""
            		DeliveryMethod="AdaptiveStreaming"
                    SelectedCaptionStreamName="textstream_eng"
            		MediaSource="http://lab.integrated-digital.com:61010/SmoothStreamingEncodes/Astroboy_SmoothStreaming_MultiAudio/Astroboy_SmoothStreaming_MultiAudio.ism/Manifest" />
            </smf:SMFPlayer.Playlist>
        </smf:SMFPlayer>
Coordinator
Apr 15, 2011 at 8:58 PM
Edited Apr 15, 2011 at 8:58 PM

seth468, you can only assign a function to an event. StartPosition and MediaSource are both properties. If you want to assign a dynamic value to these properties, you can bind to them using the StartPosition="{Binding ...}" syntax. There should be plenty of resources online about how to do data binding in Silverlight.

Tim