This project has moved. For the latest updates, please go here.

DoubleUpDown and Visibility Setter

Jul 27, 2015 at 9:20 AM
I'm using DoubleUpDown object in xaml with this code
<xctk:DoubleUpDown  FormatString="F2" Value="{Binding PosValueConst, UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True, NotifyOnValidationError=True, ValidatesOnExceptions=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" cal:Message.Attach=" [Event MouseEnter] = [Action Handler_MouseEnter($this,$eventArgs)];[Event MouseLeave] = [Action Handler_MouseLeave($this,$eventArgs)];[Event TextChanged] = [Action MarkUnsaveFile()]"  Increment="0.01" Minimum="0" ParsingNumberStyle="Number" >
            <xctk:DoubleUpDown.Style>
                <Style TargetType="{x:Type xctk:DoubleUpDown}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=EnableSubMenuPosConst}" Value="false">
                            <Setter Property="Visibility" Value="Hidden" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=EnableSubMenuPosConst}" Value="true">
                            <Setter Property="Visibility" Value="Visible" />
                        </DataTrigger>
                        <Trigger Property="Validation.HasError" Value="true">
                            <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self},Path=(Validation.Errors)[0].ErrorContent}"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </xctk:DoubleUpDown.Style>
        </xctk:DoubleUpDown>
But i got System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='1' BindingExpression:Path=PosValueConst; DataItem='MoveAbsViewModel' (HashCode=29056806); target element is 'DoubleUpDown' (Name='PosValueConst'); target property is 'Visibility' (type 'Visibility')

Why? Any idea?
Thanks
Jul 27, 2015 at 9:25 AM
Found the problem was Caliburn.Micro property x:name. Remove that solve the problem
Marked as answer by stukdev on 7/27/2015 at 2:25 AM