0

I create a new template. I wish that the ItemsPresenter will not be displayed if it is the first element. I would solve this with a trigger. But i don't know what I specify as the condition?

<Setter Property="Template">
    <Setter.Value>
        <ControlTemplate TargetType="{x:Type ribbon:Ribbon}">

            <!-- ... --> 

            <ContentControl x:Name="mainItemsPresenterHost" Grid.ColumnSpan="3" Grid.Row="2" Focusable="False">
                <Border x:Name="groupsBorder"
                            Background="{StaticResource &#205;}" 
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="1,0,1,1"
                            Height="{StaticResource &#211;}"
                            SnapsToDevicePixels="True">
                    <Border BorderThickness="0,0,0,1" Margin="0,0,0,1" BorderBrush="{StaticResource &#204;}" SnapsToDevicePixels="True">
                        <ItemsPresenter Name="ItemsPresenter">
                            <ItemsPresenter.Style>
                                <Style TargetType="ItemsPresenter">
                                    <Style.Triggers>
                                        <DataTrigger ...><!-- trigger -->
                                            <Setter Property="Visibility" Value="Collapsed"></Setter>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </ItemsPresenter.Style>
                        </ItemsPresenter>
                    </Border>
                </Border>
            </ContentControl>

            <!-- ... --> 
David
  • 4,027
  • 10
  • 50
  • 102
  • what do you mean by 'ItemsPresenter will not be displayed if it is the first element'.... – yo chauhan Jul 13 '12 at 09:51
  • this code snipped is from the ribbon control. the itemspresenter present the tabs. (tab1, tab2, ...). So now i want that the first itemspresenter (tab1) is Collapsed. – David Jul 13 '12 at 09:55

0 Answers0