Jan Bannister
Jan Bannister

Reputation: 4999

Centre the background of a TabControl in WPF

I'm trying to get an image to float unstreched in the middle of my TabControl. I started with the below XAML which stretches the image.

<TabControl>
    <TabControl.Background>
        <ImageBrush  ImageSource="/LogoTest;component/logo_final.png" />            
    </TabControl.Background>
</TabControl>

I've tried various approaches like using a VisualBrush with a Grid inside it but I can't get the desired result.

Is there a simple way of doing this that I'm missing?

Upvotes: 0

Views: 1097

Answers (1)

Wallstreet Programmer
Wallstreet Programmer

Reputation: 9677

<ImageBrush 
    ImageSource="/LogoTest;component/logo_final.png" 
    AlignmentX="Center" AlignmentY="Center" 
    Stretch="None"/>

Upvotes: 1

Related Questions