This question is locked. New answers and comments are not allowed.
I am trying to create a small reader type component that will have videos and links in them. I am trying to put a RadMediaPlayer into the DataTemplate of a listbox and it crashes at runtime with:
My template is somewhat complex, but I have tried to simplfy it as much as possible:
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.dll
My template is somewhat complex, but I have tried to simplfy it as much as possible:
<ListBox x:Name="listNews" Background="{x:Null}" BorderThickness="0"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding GroupName}" VerticalAlignment="Top" FontSize="12" FontWeight="Bold"/> <ListBox x:Name="listNewsInner" Background="{x:Null}" BorderThickness="0" ItemsSource="{Binding NewsItems}" SelectionChanged="listNewsInner_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <Grid x:Name="newsItemRoom" Margin="0,0,0,10"> <Grid.RowDefinitions> <RowDefinition Height="30"/> <RowDefinition Height="*"/> <RowDefinition Height="26"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="75"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="45"/> </Grid.ColumnDefinitions> <telerik:RadMediaPlayer VerticalContentAlignment="Top" HorizontalContentAlignment="Center" SelectedIndex="0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3"> <telerik:RadMediaItem Header="Big Buck Bunny" Source="http://localhost:1146/Video/duck.wmv"></telerik:RadMediaItem> </telerik:RadMediaPlayer> <TextBlock Text="{Binding Caption}" Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" VerticalAlignment="Top" FontSize="12" FontWeight="Bold"/> <TextBlock Text="{Binding Description}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" VerticalAlignment="Top"/> <TextBlock Text="{Binding Created}" Grid.Row="2" Grid.Column="2"/> <HyperlinkButton Content="More..." CommandParameter="{Binding LinkURL}" Grid.Row="2" Grid.Column="3"/> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>I have attempted to move this into the parent ListBox and that did not work; I attempted to move it OUT of the listbox [into the main xaml] and it worked just fine. It just seems that the media player cannot function while in a datatemplate.
I am using version 2010.2.821.1040 of the MediaPlayer.dll.
Any help would be appreciated!
