我使用自定义样式,使我的框架背景白色:
<ControlTemplate x:Key="WhiteTemplate" TargetType="toolkit:TransitionFrame">
<Grid x:Name="ClientArea">
<Grid.Background>
<ImageBrush ImageSource="Images/yourimage.png"
</Grid.Background>
<ContentPresenter x:Name="FirstContentPresenter" />
<ContentPresenter x:Name="SecondContentPresenter" />
</Grid>
</ControlTemplate>
然后,在App.xaml.cs
private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
{
// Set the root visual to allow the application to render
if (RootVisual != RootFrame)
RootVisual = RootFrame;
// Remove this handler since it is no longer needed
RootFrame.Navigated -= CompleteInitializePhoneApplication;
// Add this to inject the media element Control template
RootFrame.Template = Current.Resources["WhiteTemplate"] as ControlTemplate;
}
请注意,如果您AREN这是使用工具包.. 't使用它,你应该使用'PhoneApplicationFrame'而不是工具箱:TransitionFrame
你可以很容易地在每个页面上的属性添加到BaseViewModel并绑定到它(你很可能使用查找和替换做出改变,甚至) – 2012-04-06 15:57:18
我不想在页面级别执行此操作。为什么在应用程序级别可以完成每个页面的添加?我会把你的想法留在我的后兜里,以防我不清楚。感谢这个想法。 – Dante 2012-04-06 15:59:16