I'm trying to create a tabbed application with WPF and XNA. I'm using the D3DImage [http://msdn.microsoft.com/en-us/libr...d3dimage.aspx] class to display the rendered xna inside an Image control.

If I change the RenderTarget on the GraphicsDevice to one other than the one being used by the d3dimage, the d3dimage no longer displays the rendered xna (even the static image which was last rendered).

The following works:
// render xna to rendertarget
d3dImage.Lock();
d3dImage.AddDirtyRect(new Int32Rect(0, 0, width, height));
d3dImage.Unlock();

but if i do the following the xna in the d3dimage is lost and replaced with a dark blue:
d3dImage.Lock();
d3dImage.AddDirtyRect(new Int32Rect(0, 0, width, height));
d3dImage.Unlock();
graphicsDevice.SetRenderTarget(0, otherRenderTarget);

I need to change the RenderTarget because I have multiple D3DImages to render to.
Do you know why the rendered xna is "overwritten" even though I don't call d3dImage.AddDirtyRect()? Thanks