Description
Defines for each ObjectTypeName, what is displayed in the preview sidebar panel, or tooltip preview (the ones, displayed in a tooltip preview have the default InfoPopup. prefix of the name; or if you use DirectoryStyleSetName, then it can be something different than InfoPopup). See <InfoPanel (for tooltip preview).
Members
ObjectTypeName | includes only objects of the specified type |
DataTemplate | Defines what to display and how- |
Example
InfoPanel uses DataTemplate with grid definitions to organize displayed data, and StackPanel and ScrollViewer to display them.
<InfoPanel Name="Article" ObjectTypeName="article">
<DataTemplate>
<Grid HorizontalAlignment="Stretch" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Left" Orientation="Vertical" Grid.ColumnSpan="2">
<l:ObjectTypeIcon HorizontalAlignment="Left" ObjectType="{Binding Path=ObjectType}" Size="16"/>
<l:HighlightTextBlock Style="{DynamicResource ShellInfoHeaderStyle}" HighlightText="{Binding Path=[article:DescName]}" />
</StackPanel>
<ScrollViewer Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<l:ArticleView ItemsSource="{Binding Path=[article.txts]}">
<l:ArticleView.Resources>
<DataTemplate x:Key="txt">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Background="LightGray">
<TextBlock FontWeight="Bold" Text="{Binding Path=ObjectType.Name}" Margin="2,2,2,2"/>
<TextBlock Margin="4,2,2,2">
<TextBlock.Text>
<Binding Path="[txt.nWords]" StringFormat="Word Count: {0}"/>
</TextBlock.Text>
</TextBlock>
</StackPanel>
<l:FlowDocumentPreviewControl
l:Highlights.IsHighlightTarget="True"
VerticalScrollBarVisibility="Disabled"
IsSliderVisible="False"
ObjectId="{Binding Path=DataContext[article.id], RelativeSource={RelativeSource AncestorType={x:Type l:ArticleView}}}"
TxtXml="{Binding Path=[txt.tText]}"/>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="photoCaption">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Path=ObjectType.Name}" Background="LightGray"/>
<l:Image Grid.Row="1" Margin="0,6,6,6" Height="100" Width="100" VerticalAlignment="Top" HorizontalAlignment="Center" ImageId="{Binding Path=[photoCaption.ref.thumbnail.id]}"/>
<l:FlowDocumentPreviewControl
l:Highlights.IsHighlightTarget="True"
Grid.Row="2"
VerticalScrollBarVisibility="Disabled"
IsSliderVisible="False"
ObjectId="{Binding Path=DataContext[article.id], RelativeSource={RelativeSource AncestorType={x:Type l:ArticleView}}}"
TxtXml="{Binding Path=[photoCaption.tText]}"/>
</Grid>
</DataTemplate>
<DataTemplate x:Key="audioCaption">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Path=ObjectType.Name}" Background="LightGray"/>
<l:Audio Margin="0,6,6,6" Grid.Row="1" Height="18" Width="80" VerticalAlignment="Top" HorizontalAlignment="Center" AudioId="{Binding Path=[audioCaption.ref.data.id]}"/>
<l:FlowDocumentPreviewControl
l:Highlights.IsHighlightTarget="True" Grid.Row="2"
VerticalScrollBarVisibility="Disabled"
IsSliderVisible="False"
ObjectId="{Binding Path=DataContext[article.id], RelativeSource={RelativeSource AncestorType={x:Type l:ArticleView}}}"
TxtXml="{Binding Path=[audio.tText]}"/>
</Grid>
</DataTemplate>
<DataTemplate x:Key="videoCaption">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Path=ObjectType.Name}" Background="LightGray"/>
<l:Video Grid.Row="1" Margin="0,6,6,6" Height="100" Width="100" VerticalAlignment="Top" HorizontalAlignment="Center"
ThumbnailId="{Binding Path=[videoCaption.ref.thumbnail.id]}"
VideoId="{Binding Path=[videoCaption.ref.videoPreview.id]}"/>
<l:FlowDocumentPreviewControl
l:Highlights.IsHighlightTarget="True" Grid.Row="2"
VerticalScrollBarVisibility="Disabled"
IsSliderVisible="False"
ObjectId="{Binding Path=DataContext[article.id], RelativeSource={RelativeSource AncestorType={x:Type l:ArticleView}}}"
TxtXml="{Binding Path=[videoCaption.tText]}"/>
</Grid>
</DataTemplate>
</l:ArticleView.Resources>
</l:ArticleView>
</ScrollViewer>
<!-- <Expander IsExpanded="True" Header="Editions" Grid.Row="3"
Visibility="{Binding Path=HasItems, ElementName=editions, Converter={StaticResource VisibilityConverter}}">
<ItemsControl Name="editions" ItemsSource="{Binding Path=[article.pageLayers]}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=[article.pageLayers~editionRef.name]}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Expander>
<Expander IsExpanded="True" Grid.Row="4" Header="Assigned" Visibility="{Binding Path=HasItems, ElementName=assigned, Converter={StaticResource VisibilityConverter}}">
<ItemsControl Name="assigned" ItemsSource="{Binding Path=[article.assigns]}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=[article.assigns~editionRef.name]}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Expander>
-->
</Grid>
</DataTemplate>
</InfoPanel>