Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums

Go Back   Vista Forums > Vista technology newsgroups > Avalon

MediaTimeline and Binding

Reply
 
Thread Tools Display Modes
Old 04-13-2008   #1
ShayEr
Guest
 
Posts: n/a

MediaTimeline and Binding

I'm trying to create a simple Media playlist player using MediaTimeline.
In all of the examples that I saw that Source property is hardcoded.
When I try to set the Source using binding I get "Must specify URI." error.

I'm attaching here a full XAML source that can repro the problem.

<Window x:Class="PureXAMLPlayer.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="Window1" Height="517" Width="905">

<Grid>
<Grid.Resources>
<x:ArrayExtension Type="sys:String" x:Key="Data">
<sys:String>C:\Program Files\Microsoft
SDKs\Windows\v6.1\Samples\WPFSamples\GraphicsMM_Media\MediaGallery\csharp\bin\Debug\media\xbox.wmv</sys:String>
<sys:String>C:\Program Files\Microsoft
SDKs\Windows\v6.1\Samples\WPFSamples\GraphicsMM_Media\MediaGallery\csharp\bin\Debug\media\xbox.wmv</sys:String>
<sys:String>C:\Program Files\Microsoft
SDKs\Windows\v6.1\Samples\WPFSamples\GraphicsMM_Media\MediaGallery\csharp\bin\Debug\media\xbox.wmv</sys:String>
<sys:String>C:\Program Files\Microsoft
SDKs\Windows\v6.1\Samples\WPFSamples\GraphicsMM_Media\MediaGallery\csharp\bin\Debug\media\xbox.wmv</sys:String>
<sys:String>C:\Program Files\Microsoft
SDKs\Windows\v6.1\Samples\WPFSamples\GraphicsMM_Media\MediaGallery\csharp\bin\Debug\media\xbox.wmv</sys:String>
<sys:String>C:\Program Files\Microsoft
SDKs\Windows\v6.1\Samples\WPFSamples\GraphicsMM_Media\MediaGallery\csharp\bin\Debug\media\xbox.wmv</sys:String>
</x:ArrayExtension>
</Grid.Resources>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="146*" />
<ColumnDefinition Width="737*" />
</Grid.ColumnDefinitions>

<Grid DataContext="{StaticResource Data}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>

<ListBox HorizontalAlignment="Left" Width="230" Name="List"
ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True" />


<StackPanel Grid.Row="1">
<Button>Play
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<EventTrigger.Actions>
<BeginStoryboard Name="myBegin">
<Storyboard>
<MediaTimeline
Storyboard.TargetName="myMediaElement" >
<MediaTimeline.Source>
<Binding ElementName="List"
Path="SelectedItem.Content"/>
</MediaTimeline.Source>
</MediaTimeline>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Button.Triggers>
</Button>
<Button>Stop</Button>
<Button>Pause</Button>
</StackPanel>
</Grid>

<MediaElement Grid.Column="1" Name="myMediaElement"
HorizontalAlignment="Right" Width="737" />
</Grid>
</Window>


  Reply With Quote

Reply

Thread Tools
Display Modes









Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48