Hi , this is a known issue with ItemsControl although I couldn't find a solution :( .
XAML
<ItemsControl x:Name="myItemsControl" ItemsSource ="{Binding videos}" Grid.ColumnSpan="2">
<ItemsControl.Resources>
<DataTemplate x:Name="myDataTemplate" DataType="{x:Type sys:String}">
<Grid x:Name="sp" Width="300" Height="200">
<MediaElement x:Name="myvideo" Loaded="myvideo_Loaded" UnloadedBehavior="Stop" ScrubbingEnabled="True" Stretch="Fill" Source="{Binding}" LoadedBehavior= "Play">
</MediaElement>
</Grid>
</DataTemplate>
</ItemsControl.Resources>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<mt:TouchablePanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Grid>
so in behind code I want to do something like
private void myvideo_Loaded(object sender, RoutedEventArgs e)
{
//myvideo.Play();
// myvideo.Pause();
}
I commented it out to be able to compile.
thanks in advance