Silverlight에 대해 ComponentOne C1DataGrid 컨트롤을 사용하고 있습니다. 표준 스타일 상속이 작동하지 않습니다.ComponentOne DataGridColumnHeaderPresenter 스타일 상속이 작동하지 않습니다 (Silverlight)
<UserControl x:Class="TestSLStyles.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:sys="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<Style x:Key="BaseStyle" TargetType="Button">
<Setter Property="Background" Value="Yellow" />
</Style>
<Style x:Key="InheritedStyle" TargetType="Button" BasedOn="{StaticResource BaseStyle}">
<Setter Property="Foreground" Value="Red" />
</Style>
<Style x:Key="dchpBase" x:Name="dchpBase" TargetType="c1:DataGridColumnHeaderPresenter">
<Setter Property="Background" Value="Yellow"/>
</Style>
<Style x:Key="dchpInherited" x:Name="dchpInherited" TargetType="c1:DataGridColumnHeaderPresenter" BasedOn="{StaticResource dchpBase}">
<Setter Property="Foreground" Value="Red"/>
</Style>
</UserControl.Resources>
<StackPanel>
<Button Content="HelloWorld" x:Name="btn1" />
<Button Content="HelloWorld" x:Name="btn2" Style="{StaticResource BaseStyle}" />
<Button Content="HelloWorld" x:Name="btn3" Style="{StaticResource InheritedStyle}" />
<c1:C1DataGrid x:Name="grd1">
<c1:C1DataGrid.Columns>
<c1:DataGridTextColumn Header="Column1" x:Name="cln1" />
<c1:DataGridTextColumn Header="Column2" x:Name="cln2" HeaderStyle="{StaticResource dchpBase}" />
<c1:DataGridTextColumn Header="Column3" x:Name="cln3" HeaderStyle="{StaticResource dchpInherited}" />
</c1:C1DataGrid.Columns>
</c1:C1DataGrid>
</StackPanel>
</UserControl>
아래 화면에서 볼 수 있듯이,이 코드는 버튼의 스타일 상속을 위해 잘 작동하지만 그리드의 열 머리글 :
마지막 열 예정 여기 코드입니다 노란색 배경과 빨간색 전경이 있지만 기본 스타일은 상속되지 않습니다. 실버 라이트 5 ComponentOne은 버전에서 테스트 4.0.20103.86
Question was posted to ComponentOne's forum as well
최신 버전과 동일한 것. 우리의 지원 포럼에서도 요청하십시오 : http://our.componentone.com/groups/forum/xaml/studio-for-silverlight/, 우리의 지원을 받아 들여 – notacat
done, link added –