I would like to know the best way on intercepting a DP value and scale it by a certain factor in a way as XAML friendly as possible, without subclassing the control. Just to explain better, I'm working on a behavior that manages zoom on canvas ( and derived ) objects, and I want being easy to "unscale" certain DP ( for example line thickness ) by the current scale factor, so I would like some XAML friendly way to let the user specify which property unscale, and let me intercept to apply the proper scaling factor, that I know as the agent who is providing the zoom.
Thanks in advance,
If what you are trying to achieve is constant-width strokes when zooming in/out try zooming using transform on your Geometry objects instead of on your Visual/FrameworkElement objects.
I'm using OverrideMetadata to do the job I need.