Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: DoubleUpDown and Visibility Setter

$
0
0
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

Viewing all articles
Browse latest Browse all 2157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>