I have a simple HorizontalMenu with 4 items
I want to disable the third item (ViewC) if a custom property "Version" is set to "Version1"
I know that I can set an expression binding on the enabled property to accomplish this in this easy example ({view.custom.Version} != "Version1"), but in a more complex situation i want to call a custom method where i can create a more complex logic.
But i can't get i to work, any body that can help?
Add a scripting transform on your binding to do just about anything you need/want.
That is also a possibility but if a second item needs the same disable logic i have the same logic in two different places, therefore i wanted it a common method
Create a custom boolean property, put the logic there, then bind the menu items to that property.
If you need more details, you'll also have to provide more details, particularly about the "But i can't get i to work" part - what did you try, and what didn't work ?
1 Like
You can do what @pascal.fragnoud mentioned or if the logic is the same but with different parameters, then put your logic in a scripting function and call that function with the custom parameters from the binding script transform.
1 Like