Jump to content

Disabling a property if as a condition of two other values


MichaelVinther

Recommended Posts

Hi
I have three double properties and I want one of them to be disabled if both the two others have the value 1.0.

 

My best guess was to do something like this in OnCreatePropertyCollection()

 

List<PropertyCollectionRule> propRules = new List<PropertyCollectionRule>();
propRules.Add(new ReadOnlyBoundToNameValuesRule(PropertyNames.Threshold, false,
  TupleStruct<object, object>(PropertyNames.Alpha, 1.0),
  TupleStruct<object, object>(PropertyNames.Beta, 1.0)));
but that has causes Threshold to be disabled if any of the others have the value 1.0, not only if both.
Setting inverse=true does not give the desired result either.
 
Isn't it possible to achieve this result?

Michael Vinther

Link to comment
Share on other sites

Link to comment
Share on other sites

Well, this is the post that gave me idea to use ReadOnlyBoundToNameValuesRule, but unfortunately it doesn't seem to be able to do what I need.

Michael Vinther

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...