Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear all,

I've looked around to find an elegant solution to my problem, but not with a log of success... [sigh]

I would like to prevent a control (custom label, custom button,...) from being rendered (drawn, painted.. ?) based on a condition (actually, a database linked security check)
but not by using the visibility or opacity properties as I would like to keep these properties freely usable by the users of the control in design mode.

I tried to override OnRender, passing a null drawingContext etc. but it doesn't work.

Does anyone have an idea how to do this ?

Thanks all!
Posted

1 solution

You could always create an empty style for the control if necessary.

Apply a DataTrigger to apply this style based on your condition.

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900