Search code examples
xamlwindows-phone-7code-behind

code-behind inline inside event handler


This xaml points to an event handler member function in the Completed event:

<Storyboard x:Name="myStory" Completed="myStoryCompleted" FillBehavior="Stop">
    <!-- storyboard things -->
</Storyboard>

As in my case I just want to play a simple sound when the Storyboard ends (don't know of a way to include sounds in a Storyboard!), I'd like to have "inline codebehind" in that Completed... if it's possible. Is it? Something like this:

<Storyboard x:Name="myStory" Completed="{mysound.Play();}" FillBehavior="Stop">
    <!-- storyboard things -->
</Storyboard>

<MediaElement x:Name="mysound" Source="/mysound.mp3" Volume="100" />

Solution

  • Seems not possible after all. :-P