<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Telerik.UI.Xaml.Controls.Primitives"
    xmlns:localTheming="using:Telerik.UI.Xaml.Controls.Primitives.Theming">

    <localTheming:PaletteInitializer x:Key="PaletteInitializer"/>

    <Style TargetType="local:RadLegendControl">
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Foreground" Value="{StaticResource TelerikSecondaryForegroundBrush}" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <WrapGrid MaximumRowsOrColumns="3"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Rectangle Margin="0 0 2 2" Width="10" Height="10" Fill="{Binding Fill}" Stroke="{Binding Stroke}" StrokeThickness="1"/>
                        <TextBlock Margin="2" Text="{Binding Title}" />
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:RadLegendControl">
                    <Border Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" Padding="{TemplateBinding Padding}">
                        <ItemsControl x:Name="PART_LegendPresenter" 
                                      ItemsPanel="{TemplateBinding ItemsPanel}" 
                                      ItemTemplate="{TemplateBinding ItemTemplate}"  
                                      Margin="10" 
                                      VerticalAlignment="{TemplateBinding VerticalAlignment}" 
                                      HorizontalAlignment="{TemplateBinding HorizontalAlignment}" 
                                      ItemsSource="{Binding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.Primitives/Themes/HubTile.xaml"/>
        <ResourceDictionary Source="ms-appx:///Telerik.UI.Xaml.Primitives/Themes/Pagination.xaml"/>
    </ResourceDictionary.MergedDictionaries>

</ResourceDictionary>

