I'm using custom background image in Pivot (not Panorama) Application:
<controls:Pivot Title="My Application">
<controls:Pivot.Background>
<ImageBrush ImageSource="Theme1.png" Stretch="Fill"/>
</controls:Pivot.Background>
It works fine, but I would like to replace the image at run-time. Is it possible?
You can give your ImageBrush a name:
<ImageBrush x:Name="ibPivot" ImageSource="Theme1.png" Stretch="Fill"/>
Then change the source in the code-behind:
BitmapImage bi = new BitmapImage(new Uri("mySecondImage.png", UriKind.Relative));
ibPivot.ImageSource = bi;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With