3 c# silverlight xaml windows-phone-7
我在Pivot中使用自定义背景图像(不是全景)应用程序:
<controls:Pivot Title="My Application">
<controls:Pivot.Background>
<ImageBrush ImageSource="Theme1.png" Stretch="Fill"/>
</controls:Pivot.Background>
Run Code Online (Sandbox Code Playgroud)
它工作正常,但我想在运行时替换图像.可能吗?
你可以给你ImageBrush
一个名字:
<ImageBrush x:Name="ibPivot" ImageSource="Theme1.png" Stretch="Fill"/>
Run Code Online (Sandbox Code Playgroud)
然后在代码隐藏中更改源代码:
BitmapImage bi = new BitmapImage(new Uri("mySecondImage.png", UriKind.Relative));
ibPivot.ImageSource = bi;
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2748 次 |
最近记录: |