This is a migrated thread and some comments may be shown as answers.

Need help with ContainerBindings

1 Answer 54 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Robert
Top achievements
Rank 1
Robert asked on 01 Mar 2012, 03:38 AM
When the user clicks the icon in the lower right corner of the player to show the list of videos, is there a way to bind to and display multiple pieces of information related to each video? For example, along with the video title I'd like to display the video date and a genre.

Thanks.


       <telerik:RadMediaPlayer x:Name="player" IsChaptersPanelPinned="True" IsVideoPanelPinned="False" SelectedIndex="0">
               <telerik:RadMediaPlayer.ItemTemplate>
                   <DataTemplate>
 
                       <telerik:ContainerBinding.ContainerBindings>
                           <telerik:ContainerBindingCollection>
                               <telerik:ContainerBinding PropertyName="Source" Binding="{Binding VideoUrl}" />
                               <telerik:ContainerBinding PropertyName="Title" Binding="{Binding Title}" />
                               <telerik:ContainerBinding PropertyName="Content" Binding="{Binding Title}"/>
                           </telerik:ContainerBindingCollection>
                       </telerik:ContainerBinding.ContainerBindings>
 
                       <StackPanel Orientation="Horizontal">
                           <StackPanel Margin="8">
                               <TextBlock Text="Name: " FontWeight="Normal" />
                               <TextBlock Text="{Binding}" Margin="4" FontWeight="Bold" />
                           </StackPanel>
                       </StackPanel>
 
                   </DataTemplate>
               </telerik:RadMediaPlayer.ItemTemplate>
</telerik:RadMediaPlayer>




public class Video
    {
        public string Title { get; set; }
        public DateTime UploadDate { get; set; }
        public string Category { get; set; }
        public string MediaType { get; set; }
        public string Region { get; set; }
        public string VideoDescription { get; set; }
        public string VideoUrl { get; set; }
}


1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 05 Mar 2012, 03:00 PM
Hi Robert ,

 I prepared a sample project for you that uses your code. Basically, the only property that you need to use in ContainerBindings (SL4) or StyleBindigns (SL5) is the Source Property of the MediaItem. 
Please check out the suggested solution and let us know if it satisfies you.

All the best,
Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
MediaPlayer
Asked by
Robert
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or