开发者

How to create a datagrid with wav-files in WPF

I hope somebody could help me. I want to add a wav-file for every object in my objectlist. The class is bound to an ObservableCollection. But I want to know the easiest way to read and play these wav-files from a datagrid using SoundPlayer?

public string CoName
{
   get { re开发者_JAVA百科turn coName; }
   set 
   { 
         coName = value;
         Changed("CoName");
   }
}

public byte[] CoSound
{
   get { return coSound; }
   set 
   { 
         coSound = value;
         Changed("CoSound");
   }
}


You could use MediaElement.

You should bind the Source property of MediaElement to the wav file (CoSound?).

You should also define the style of the datagrid so that the column you want to put the sound on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜