をListBox
使用していDataTemplate
ます。シングルはとListBoxItems
として表示されます。インナーのアイテムには使用せずにスタイルを使用したいと思います。残念ながら、これを不可能にしているように見える継承元。それとも、ここで何か不足していますか?TextBlock
ComboBox
ListBoxItems
ComboBoxes
ComboBoxItem
ListBoxItem
<ListBox Grid.Row="1" Grid.Column="1" Name="comboBoxI" Margin="2"
ItemsSource="{Binding SomeCollection}" IsSynchronizedWithCurrentItem="True">
<ListBox.Resources>
<Style TargetType="ListBoxItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent"/>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent"/>
</Style.Resources>
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" Width="320" Padding="1,1,1,1"
<TextBlock.ToolTip>
<ToolTip Content="{Binding Path=Description}"/>
</TextBlock.ToolTip>
</TextBlock>
<ComboBox ItemsSource="{Binding SomeOtherCollection}" IsSynchronizedWithCurrentItem="True"
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding CreationInfo}" Width="Auto" Padding="1,1,1,1">
<TextBlock.ToolTip>
<ToolTip Content="{Binding Path=Description}"/>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
に別のスタイルを追加しようとしましComboBoxItem
たが、この場合、色をデフォルトにリセットする方法がわかりません。
ご提案ありがとうございます。
ヘンドリック。