Question

I'm learning WPF at the moment.

I have a vector graphics canvas that I'd like to use as the background for a button, but I can't seem to find a way to do this in the documentation. I thought this would be an obvious thing to want to do.

Regards, Mark

Was it helpful?

Solution

You can use a VisualBrush :

<Button Content="Hello">
    <Button.Background>
        <VisualBrush>
            <VisualBrush.Visual>
                <!-- Your vector graphics here -->
            </VisualBrush.Visual>
        </VisualBrush>
    </Button.Background>
</Button>

OTHER TIPS

Apologies,

I think I've found the solution. DrawingBrush.

Thanks, Mark

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top