locked
how to add background image in Windows 8 metro style grid app? RRS feed

  • Question

  • Can any body tell me how to add background image in windows 8 grid view metro style application.

    I have tried in group detail page, group item detail page and item detail page. but not succeeded to add in app background Please help me

    MSP GCU Lahore

    Sunday, November 18, 2012 6:23 PM

Answers

  • Hi Aleem,

    You can just put Dave's script in the .xaml file. And if you would like to change backgroud of all pages in the Windows Store app, please put the following style definition under the <ResourceDictionary.MergedDictionaries> node in the App.xaml file:

    <Style TargetType="Grid" x:Key="gridBackground">
                    <Setter Property="Background">
                        <Setter.Value>
                            <ImageBrush ImageSource="Images/2813527_143323027029_2.jpg"/>
                        </Setter.Value>
                    </Setter>
    </Style>
    Then use the style in the grid control:
    <Grid Style="{StaticResource gridBackground}">

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, November 20, 2012 6:25 AM
    Moderator
  • <Grid>

    <Grid.Background>

    <ImageBrush source="" />

    </Grid.Background>

    </grid>


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Sunday, November 18, 2012 6:34 PM

All replies

  • <Grid>

    <Grid.Background>

    <ImageBrush source="" />

    </Grid.Background>

    </grid>


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Sunday, November 18, 2012 6:34 PM
  • where I have to write this code???

    MSP GCU Lahore

    Sunday, November 18, 2012 6:36 PM
  • Hi Aleem,

    You can just put Dave's script in the .xaml file. And if you would like to change backgroud of all pages in the Windows Store app, please put the following style definition under the <ResourceDictionary.MergedDictionaries> node in the App.xaml file:

    <Style TargetType="Grid" x:Key="gridBackground">
                    <Setter Property="Background">
                        <Setter.Value>
                            <ImageBrush ImageSource="Images/2813527_143323027029_2.jpg"/>
                        </Setter.Value>
                    </Setter>
    </Style>
    Then use the style in the grid control:
    <Grid Style="{StaticResource gridBackground}">

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, November 20, 2012 6:25 AM
    Moderator
  • hi,

    how about javascript

    Manhal

    Friday, January 25, 2013 2:51 PM