views:

109

answers:

0

I have a style which toggles the visibility of an image depending on an underlying DataContext property. Unfortunately I keep getting an error:

'Must specify both property and value for setter'

The XAML looks like

        <Style TargetType="{x:Type igDP:LabelPresenter}" x:Key="BuySellLabelStyle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type igDP:LabelPresenter}">
                    <StackPanel Orientation="Horizontal" >
                        <Grid x:Name="BuySellLabelStyleHelpIcon" Visibility="Collapsed">
                            <Image DockPanel.Dock="Left" 
                                   Source="/CS.Core.Wpf;component/Resources/help_32.png" 
                                   ToolTip="When resolving a break on direction between a risk trade and an unwound trade, the direction of the risk trade will be reversed." 
                            />
                        </Grid>
                        <ContentPresenter 
                            DockPanel.Dock="Left"
                            ContentTemplate="{TemplateBinding Content}" 
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}" 
                            VerticalAlignment="{TemplateBinding VerticalAlignment}" 
                            />
                    </StackPanel>
                    <ControlTemplate.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type vw:ResolveBreakView}}, Path=DataContext.CurrentlySelectedBreakIsUnwindBreak}">
                                <DataTrigger.Setters>
                                <Setter TargetName="BuySellLabelStyleHelpIcon" Property="Visibility" Value="Visible" />
                                </DataTrigger.Setters>
                            </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Any ideas what's causing this error?