如何从后台代码替换Pivot应用程序背景?

| 我在Pivot(不是Panorama)应用程序中使用自定义背景图片:
<controls:Pivot Title=\"My Application\">
<controls:Pivot.Background>
    <ImageBrush ImageSource=\"Theme1.png\" Stretch=\"Fill\"/>
</controls:Pivot.Background>
它工作正常,但我想在运行时替换图像。可能吗?     
已邀请:
        您可以给
ImageBrush
起一个名字:
<ImageBrush x:Name=\"ibPivot\" ImageSource=\"Theme1.png\" Stretch=\"Fill\"/>
然后在后面的代码中更改源:
BitmapImage bi = new BitmapImage(new Uri(\"mySecondImage.png\", UriKind.Relative));
ibPivot.ImageSource = bi;
    

要回复问题请先登录注册