
I have a button that displays a video that is playing. It plays fine in other applications but does not play in the ribbon control. I see the button fine but no video at all. I am using the following code:
<ribbon:Tab Label="Video" KeyTipAccessText="C">
<ribbon:Group Label="Video Feeds">
<ribbon:CustomControl>
<Button Width="80" Height="60" Margin="5,0,0,0">
<Grid Height="50">
<MediaElement Name="myMediaElement1" Volume="0">
<MediaElement.Triggers>
<EventTrigger RoutedEvent="MediaElement.Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<MediaTimeline Source="videos/butterfly.wmv" Storyboard.TargetName="myMediaElement1"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</MediaElement.Triggers>
</MediaElement>
</Grid>
</Button>
</ribbon:CustomControl>
</ribbon:Group>
</ribbon:Tab>
Also, when running the application, if I switch to a different tab then back to the tab that contains this code, the application crashes saying:
"myMediaElement1 name cannot be found in the name scope of System.Windows.Controls.MediaElement"
[Modified at 06/25/2007 06:06 PM]
<ribbon:Tab Label="Video" KeyTipAccessText="C">
<ribbon:Group Label="Video Feeds">
<ribbon:CustomControl>
<Button Width="80" Height="60" Margin="5,0,0,0">
<Grid Height="50">
<MediaElement Name="myMediaElement1" Volume="0">
<MediaElement.Triggers>
<EventTrigger RoutedEvent="MediaElement.Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<MediaTimeline Source="videos/butterfly.wmv" Storyboard.TargetName="myMediaElement1"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</MediaElement.Triggers>
</MediaElement>
</Grid>
</Button>
</ribbon:CustomControl>
</ribbon:Group>
</ribbon:Tab>
Also, when running the application, if I switch to a different tab then back to the tab that contains this code, the application crashes saying:
"myMediaElement1 name cannot be found in the name scope of System.Windows.Controls.MediaElement"
[Modified at 06/25/2007 06:06 PM]