1

I am using WPF extended toolkit to display a simple input box.

xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"

...

<Label Content="TraceTime(ms): " />
<xctk:IntegerUpDown Value="{Binding TraceTime}" Maximum="5000" Minimum="0"/>

The value of the input represents the duration to perform an action. When the value is 0, my business logic will interpret that as an infinite duration. Now I would like to modify the control so that if the user enters the value 0, the text displayed in the input box is replaced with the "∞" symbol. How would I go about doing this, or is it even feasible?

DaveS
  • 895
  • 1
  • 8
  • 20
  • Hello. First, you have to be sure that the _IntegerUpDown_ can display the "∞" symbol. If not, you will have to find a workaround like creating your own control. If this is possible, you can either use a converter, or do the treatment in the _Tracetime_ property. – P.Manthe Oct 25 '17 at 05:04
  • the low effort way here would probably be to have a textbox that has the exact size as the text area of the `IntegerUpDown` box with the inifinite sign hardcoded as the content. Then place it exactly over the textarea of the `IntegerUpDown` control's text area and switch the visibility of the `textbox` based upon the value of the `IntegerUpDown` control. Either use a seperate property for that or bind directly and create your own converter. – Steffen Winkler Aug 22 '18 at 10:43

0 Answers0