moogs
moogs

Reputation: 8202

Interpreting WPF Dependency properties as a set

So, I have a control. It displays an image based some xml document and an optional parameter

So:

<XMLRenderingWidget Document="xxxxxx"/>

The above will render the document once

<XMLRenderingWidget Document="xxxxxx" RenderingOption="Sharpen"/>

The above will, sometimes render the document once, more oftentimes:

I do the rendering on the PropertyChangedCallback assigned to the property. How do I tell the control to "hey, before doing the rendering, apply the changes on the other properties being set, too"

Is this not possible? Should I bundle them up as one property instead?

Upvotes: 2

Views: 57

Answers (1)

majocha
majocha

Reputation: 1191

Try defering the execution with

Dispatcher.BeginInvoke(new Action(DoRender), DispatcherPriority.ContextIdle);

dispatcher will finish updating properties before executing your action.

Upvotes: 1

Related Questions