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.
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?
public int Count
{
get { return table.Rows.Count; }
}
I will try the converter.
Can we write a behavior instead of a value converter?
Any suggestions?
Thanks. Converter is a good idea.
Got that resolved.