我希望我的 HeaderedItemsControl 看起来像这样:
标题与内容项内联。
然而,这就是它目前的样子:
标题不与内容项内联这是我的 xaml:
<HeaderedItemsControl Name="TagCloud" Margin="5,3">
<HeaderedItemsControl.ItemsSource>
<CompositeCollection>
<data:Keyword Word="data 1" IsSelected="True"/>
<data:Keyword Word="data 2" IsSelected="False"/>
<data:Keyword Word="data 3" IsSelected="True"/>
<data:Keyword Word="data 1" IsSelected="True"/>
<data:Keyword Word="data 2" IsSelected="False"/>
<data:Keyword Word="data 3" IsSelected="True"/>
<data:Keyword Word="data 1" IsSelected="True"/>
<data:Keyword Word="data 2" IsSelected="False"/>
<data:Keyword Word="data 3" IsSelected="True"/>
</CompositeCollection>
</HeaderedItemsControl.ItemsSource>
<HeaderedItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</HeaderedItemsControl.ItemsPanel>
<HeaderedItemsControl.Header>
<TextBlock Text="Tags: " Margin="0,8,3,0" />
</HeaderedItemsControl.Header>
<HeaderedItemsControl.Template>
<ControlTemplate TargetType="{x:Type HeaderedItemsControl}">
<WrapPanel>
<ContentPresenter ContentSource="Header" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</WrapPanel>
</ControlTemplate>
</HeaderedItemsControl.Template>
<HeaderedItemsControl.ItemTemplate>
<DataTemplate>
<ToggleButton Name="tagButton" Content="{Binding Word}" IsChecked="{Binding IsSelected}" />
</DataTemplate>
</HeaderedItemsControl.ItemTemplate>
</HeaderedItemsControl>
我应该改变什么?