C# 设置itempage.xaml的背景图像

C# 设置itempage.xaml的背景图像,c#,xaml,windows-phone-8,windows-phone-8.1,C#,Xaml,Windows Phone 8,Windows Phone 8.1,我正在开发windows phone 8.1应用程序,当我为hubpage.xaml设置背景图像时,它不会影响itempage.xaml。有人能帮我为应用程序中的所有其他页面设置相同的背景吗?无论如何,我都在使用中心模板 这是因为xaml上的属性是特定于页面的。 如果要使用相同的背景,可以在xaml中手动为每个页面分配一个背景(请参阅HubPage.xaml的Hub部分的background属性) 或者,您可以覆盖您的应用程序页面背景mebrush,并将其设置为所需的背景。 编辑App.xaml

我正在开发windows phone 8.1应用程序,当我为hubpage.xaml设置背景图像时,它不会影响itempage.xaml。有人能帮我为应用程序中的所有其他页面设置相同的背景吗?无论如何,我都在使用中心模板

这是因为xaml上的属性是特定于页面的。 如果要使用相同的背景,可以在xaml中手动为每个页面分配一个背景(请参阅HubPage.xaml的
Hub
部分的
background
属性)

或者,您可以覆盖您的
应用程序页面背景mebrush
,并将其设置为所需的背景。 编辑App.xaml并向
ResourceDictionary
添加新条目

<ResourceDictionary x:Key="Default">
    <ImageBrush x:Key="HubBackgroundImageBrush" ImageSource="Assets/HubBackground.png"/>
    <ImageBrush x:Key="ApplicationPageBackgroundThemeBrush" ImageSource="Assets/HubBackground.png"/>
</ResourceDictionary>