This question is locked. New answers and comments are not allowed.
I try to make RadLegendItemStyl with CheckBox.
RadLegendStyle is here.
<Style x:Key="ChartLegendStyle1" TargetType="Telerik_Windows_Controls_Charting:ChartLegend">
<Setter Property="Foreground" Value="{StaticResource LegendForeground}"/>
<Setter Property="Background" Value="{StaticResource LegendBackground}"/>
<Setter Property="Padding" Value="10,10,10,5"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="BorderBrush" Value="{StaticResource LegendBorderBrush}"/>
<Setter Property="BorderThickness" Value="1,1,1,1"/>
<Setter Property="TitleFontWeight" Value="Bold"/>
<Setter Property="LegendItemStyle" Value="{StaticResource ChartLegendItemStyle1}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Telerik_Windows_Controls_Charting:ChartLegend">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid Margin="{TemplateBinding Padding}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentControl ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding TitleFontWeight}"/>
<ItemsPresenter Grid.Row="1" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<telerik:RadWrapPanel Orientation="{Binding ItemsPanelOrientation}"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<Grid>
<TextBlock FontSize="12"
HorizontalAlignment="Left" Height="Auto" Width="Auto" Padding="0,0,0,2" Text="{Binding}" />
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
And RadLegendItemStyle is here
<Style x:Key="ChartLegendItemStyle1" TargetType="Telerik_Windows_Controls_Charting:ChartLegendItem">
<Setter Property="Foreground" Value="{StaticResource LegendForeground}"/>
<Setter Property="Padding" Value="5,0,5,0"/>
<Setter Property="Margin" Value="0,3,0,2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Telerik_Windows_Controls_Charting:ChartLegendItem">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Path x:Name="PART_LegendItemMarker" Data="" Height="16" Margin="0,0.328,0,-0.329" Style="{TemplateBinding ItemStyle}" Stretch="Fill" Width="16" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask}" Height="14" Margin="1,1.163,1,0.836" OpacityMask="{StaticResource LegendItemMarkerMaskOpacityMask}" Stretch="Fill" Stroke="{StaticResource LegendItemMarkerMaskStroke}" StrokeThickness="{StaticResource LegendItemMarkerMaskStrokeThickness}" Width="14" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask2}" Height="14" Margin="1,1.163,1,0.836" Stretch="Fill" Width="14" UseLayoutRounding="False"/>
<TextBlock Grid.Column="1" Foreground="{TemplateBinding Foreground}" Margin="{TemplateBinding Margin}" Padding="{TemplateBinding Padding}" Text="{TemplateBinding Label}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
MainPage.Xaml Source here,
<Grid x:Name="LayoutRoot" Background="White">
<Telerik_Windows_Controls:RadChart Content="RadChart" x:Name="radChart1"
LegendStyle="{StaticResource ChartLegendStyle1}"/>
<Telerik_Windows_Controls_Charting:ChartLegendItem Margin="0,-37,0,0" VerticalAlignment="Top" Style="{StaticResource ChartLegendItemStyle1}" Width="113" Height="21" HorizontalAlignment="Left"/>
</Grid>
Don't Displayed Code. Source is below!!
<Path x:Name="PART_LegendItemMarker" Data="" Height="16" Margin="0,0.328,0,-0.329" Style="{TemplateBinding ItemStyle}" Stretch="Fill" Width="16" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask}" Height="14" Margin="1,1.163,1,0.836" OpacityMask="{StaticResource LegendItemMarkerMaskOpacityMask}" Stretch="Fill" Stroke="{StaticResource LegendItemMarkerMaskStroke}" StrokeThickness="{StaticResource LegendItemMarkerMaskStrokeThickness}" Width="14" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask2}" Height="14" Margin="1,1.163,1,0.836" Stretch="Fill" Width="14" UseLayoutRounding="False"/>
CheckBox and TextBlock is displayed but Marker is not displayed
What Can I do?
LegendItem Marker is vanished in LegendItemStyle When I try to fix LegendItemStyle.
RadLegendStyle is here.
<Style x:Key="ChartLegendStyle1" TargetType="Telerik_Windows_Controls_Charting:ChartLegend">
<Setter Property="Foreground" Value="{StaticResource LegendForeground}"/>
<Setter Property="Background" Value="{StaticResource LegendBackground}"/>
<Setter Property="Padding" Value="10,10,10,5"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="BorderBrush" Value="{StaticResource LegendBorderBrush}"/>
<Setter Property="BorderThickness" Value="1,1,1,1"/>
<Setter Property="TitleFontWeight" Value="Bold"/>
<Setter Property="LegendItemStyle" Value="{StaticResource ChartLegendItemStyle1}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Telerik_Windows_Controls_Charting:ChartLegend">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Grid Margin="{TemplateBinding Padding}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ContentControl ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding TitleFontWeight}"/>
<ItemsPresenter Grid.Row="1" />
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<telerik:RadWrapPanel Orientation="{Binding ItemsPanelOrientation}"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<Grid>
<TextBlock FontSize="12"
HorizontalAlignment="Left" Height="Auto" Width="Auto" Padding="0,0,0,2" Text="{Binding}" />
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
And RadLegendItemStyle is here
<Style x:Key="ChartLegendItemStyle1" TargetType="Telerik_Windows_Controls_Charting:ChartLegendItem">
<Setter Property="Foreground" Value="{StaticResource LegendForeground}"/>
<Setter Property="Padding" Value="5,0,5,0"/>
<Setter Property="Margin" Value="0,3,0,2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Telerik_Windows_Controls_Charting:ChartLegendItem">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Path x:Name="PART_LegendItemMarker" Data="" Height="16" Margin="0,0.328,0,-0.329" Style="{TemplateBinding ItemStyle}" Stretch="Fill" Width="16" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask}" Height="14" Margin="1,1.163,1,0.836" OpacityMask="{StaticResource LegendItemMarkerMaskOpacityMask}" Stretch="Fill" Stroke="{StaticResource LegendItemMarkerMaskStroke}" StrokeThickness="{StaticResource LegendItemMarkerMaskStrokeThickness}" Width="14" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask2}" Height="14" Margin="1,1.163,1,0.836" Stretch="Fill" Width="14" UseLayoutRounding="False"/>
<TextBlock Grid.Column="1" Foreground="{TemplateBinding Foreground}" Margin="{TemplateBinding Margin}" Padding="{TemplateBinding Padding}" Text="{TemplateBinding Label}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
MainPage.Xaml Source here,
<Grid x:Name="LayoutRoot" Background="White">
<Telerik_Windows_Controls:RadChart Content="RadChart" x:Name="radChart1"
LegendStyle="{StaticResource ChartLegendStyle1}"/>
<Telerik_Windows_Controls_Charting:ChartLegendItem Margin="0,-37,0,0" VerticalAlignment="Top" Style="{StaticResource ChartLegendItemStyle1}" Width="113" Height="21" HorizontalAlignment="Left"/>
</Grid>
Don't Displayed Code. Source is below!!
<Path x:Name="PART_LegendItemMarker" Data="" Height="16" Margin="0,0.328,0,-0.329" Style="{TemplateBinding ItemStyle}" Stretch="Fill" Width="16" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask}" Height="14" Margin="1,1.163,1,0.836" OpacityMask="{StaticResource LegendItemMarkerMaskOpacityMask}" Stretch="Fill" Stroke="{StaticResource LegendItemMarkerMaskStroke}" StrokeThickness="{StaticResource LegendItemMarkerMaskStrokeThickness}" Width="14" UseLayoutRounding="False"/>
<Path Data="" Fill="{StaticResource LegendItemMarkerMask2}" Height="14" Margin="1,1.163,1,0.836" Stretch="Fill" Width="14" UseLayoutRounding="False"/>
CheckBox and TextBlock is displayed but Marker is not displayed
What Can I do?
LegendItem Marker is vanished in LegendItemStyle When I try to fix LegendItemStyle.