adding media element in windows phone 7?

前端 未结 2 1704
再見小時候
再見小時候 2020-12-04 04:08

I want to play an audio of an image whenever click on it .If we click on another image that sound will play in that way we want write the logic.

2条回答
  •  甜味超标
    2020-12-04 04:33

    If you're binding to an object that has the image uri and audio clip uri:

    
    

    then in the event handler

        void img_MouseLeftButtonDown(object sender,MouseButtonEventArgs e)
        {
    Image img = sender as Image;
    if (img != null)
    mePlayer.Source = img.Tag as Uri;
        }
    

提交回复
热议问题