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

IntegerUpDown Minimum and Maximum in Tooltip

Apr 26, 2016 at 10:22 AM
Hi.
I want to show user minimum and maximum value in Tooltip, but it does't work (Tooltip is empty).
I try to bind by ElementName, with FindAncestor - nothing.
If I set binding from external TextBlock - it works.

How I can achieve that?
Developer
Apr 26, 2016 at 8:30 PM
Hi,

You can use this :
 <xctk:IntegerUpDown Margin="5"
                        Minimum="0"
                        Maximum="10"
                        ToolTip="{Binding Maximum, RelativeSource={RelativeSource Self}}" />
And maybe add a Converter to support a binding on Minimum and Maximum values.
Apr 27, 2016 at 7:30 AM
Thank You, this works, but I want to add Minimum and Maximum values to ToolTip. I try to do like this:
<toolkit:IntegerUpDown x:Name="integerUpDown">
  <toolkit:IntegerUpDown.ToolTip>
        <StackPanel>  
           <TextBlock Text="{Binding ElementName=integerUpDown, Path=Minimum, StringFormat=Min: {0}}" />
           <TextBlock Text="{Binding ElementName=integerUpDown, Path=Maximum, StringFormat=Max: {0}}" />
         </StackPanel>  
           </toolkit:IntegerUpDown.ToolTip>
  </toolkit:IntegerUpDown>
Tooltip Shows, but empty. Also I try instead ElementName to do with FindAncestor - without positive.

Any Ideas?
Developer
Apr 27, 2016 at 12:29 PM
Try this :
 <xctk:IntegerUpDown x:Name="integerUpDown"
                        Margin="5"
                        Minimum="0"
                        Maximum="10">
      <xctk:IntegerUpDown.ToolTip>
        <ToolTip DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}">
          <StackPanel>
            <TextBlock Text="{Binding Minimum, StringFormat=Min: {0}}" />
            <TextBlock Text="{Binding Maximum, StringFormat=Max: {0}}" />
          </StackPanel>
        </ToolTip>
      </xctk:IntegerUpDown.ToolTip>
</xctk:IntegerUpDown>
Apr 27, 2016 at 2:28 PM
This works, thank You! (but it's quite weird;) )