我使用自定义样式使我的框架背景变为白色:
<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;
}
请注意,这是使用工具包。如果您不使用它,您可能应该使用“PhoneApplicationFrame”而不是工具包:TransitionFrame