Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
505
When MaxValue = 0, slider.Visibility = Collapsed
posted

How can I achieve this?

Is this possible by writing a behaviour?

My case is:

table.count is double to maxvalue. this gives me an error, because slider doesnt like maxvalue = 0;

 

If maxvalue is 0, then i want my slider to be Collapsed or disabled.

Please help.

 

Any code snippet/ sample project are greatly appreciated

 

Thanks,

Jowen.

Parents
No Data
Reply
  • 21382
    posted

    Are you binding the .Count to the .MaxValue?  If you are doing that then I would probably put a valueConverter on binding so that when count goes to zero you return 1 (so your max and min would be different)

    After that I would bind the .Count to the .Enabled of the control through a value converter and if zero then return false.  So the control would disable.

    But that assumes that Count is a bindable property and will raise a property changed notification.

     

    How are you connecting the Count to the MaxValue?

Children