Search code examples
c#wpfinkcanvas

InkCanvas and ZIndex


InkCanvas stores all the drawing etc in "Strokes" collection and stores all the controls in "Children".

When I draw something then create a TextBox the TextBox remains under the drawing. I can't change its zIndex to bring it forward.

Is there a way to bring the text on top?


Solution

  • InkCanvas is not really meant for content other than strokes. But you could add the TextBox to another Panel that is over the InkCanvas, e.g.:

    <Grid>
        <InkCanvas/>
        <Canvas>
            <TextBox/>
        </Canvas>
    </Grid>