I want to create a breadcrumb control that has a button at the beginning that will clear the breadcrumb items. My problem is getting that first button to wrap properly with the rest of the items. Here's my style:
<Style TargetType="{x:Type local:Breadcrumb}">
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<Button Content="{Binding}"
FontSize="{Binding RelativeSource={RelativeSource AncestorType=local:Breadcrumb}, Path=BreadcrumbFontSize}"
FontFamily="{Binding RelativeSource={RelativeSource AncestorType=local:Breadcrumb}, Path=BreadcrumbFont}"
FontWeight="{Binding RelativeSource={RelativeSource AncestorType=local:Breadcrumb}, Path=BreadcrumbFontWeight}"
Width="{Binding RelativeSource={RelativeSource AncestorType=local:Breadcrumb}, Path=BreadcrumbItemWidth}"
Height="{Binding RelativeSource={RelativeSource AncestorType=local:Breadcrumb}, Path=BreadcrumbItemHeight}"
Margin="0,0,-22,10"
Style="{DynamicResource BreadcrumbButton}" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ItemsControl}">
<WrapPanel>
<Button Content="Menu" Height="{Binding RelativeSource={RelativeSource AncestorType=local:Breadcrumb}, Path=BreadcrumbItemHeight}"
Width="{Binding RelativeSource={RelativeSource AncestorType=local:Breadcrumb}, Path=BreadcrumbItemWidth}"/>
<ItemsPresenter Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" />
</WrapPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
When all of the items fit on the same line it displays properly:
When it starts to wrap, it pushes all of the items below the "Menu" button:
Is there a way that I can update this so that the other elements do not go below the Menu button?