Hey, I want to use background music in my WPF Application. Like you can see here: http://stackoverflow.com/questions/3148965/how-to-do-background-music-for-my-wpf-application
So I use a MediaElement.
Now I want to change the source of it while running the Application.
I'm already doing something similar with some background pictures. There I have different ResourceDictionaries that I'm switching to show different "themes".
One of my dictionaries looks like this:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ImageBrush x:Key="Backgroundpic" ImageSource="picture.png"/>
...
</ResourceDictionary>
So I can use it in the xaml like this:
...
<Grid x:Name="Bg" Background="{DynamicResource Backgroundpic}"/>
...
But HOW can I do that with my MediaElement-Source that I can use it like this:
<MediaElement x:Name="myMediaElement" Source="{DynamicResource ???}" />
I just don't know what to write into my ResourceDictionary.