Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista Tutorial - MediaTimeline and Binding

 
 
Old 04-13-2008   #1 (permalink)
ShayEr
Guest


 
 

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>



My System SpecsSystem Spec
 

Thread Tools



Vista Forums 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 Ltd

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