Background image is fixed RRS feed

  • Question

  • Hello,
    I have a problem, I have a page with a background image, my problem is that the background image does not move when I do a horizontal scroll on the page.
    I am using C # and xaml

    Rui Peres - C# Fã

    Sunday, December 8, 2013 7:19 PM

All replies

  • Hi Rui,

    I'll move this to a more appropriate forum for you. The UI Design for Windows Store apps forum is for discussion of UI design, not for questions about implementing the app.

    To scroll your background image you will need to put the image inside your ScrollViewer (or other scrolling control). The root of the page itself doesn't scroll. If you need more details you'll need to provide more information about how exactly your page is set up. Showing minimal Xaml that demonstrates how your app is using it would help.


    Sunday, December 8, 2013 7:40 PM
  • The code of my page.

        DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
        Background="{StaticResource GrayBackgroundApp}">
            <x:String x:Key="ChevronGlyph">&#xE26B;</x:String>
            <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
            <x:String x:Key="AppName">My Application</x:String>
            This grid acts as a root panel for the page.
        <Grid >
            <ScrollViewer VerticalScrollMode="Enabled" HorizontalScrollMode="Disabled">
                <Hub >
                    <HubSection Background="{StaticResource BlueBackgroundApp}" Width="500"></HubSection>

    I've tried to set the background in ScrollViewer but is still static.
    The GrayBackgroundApp and BlueBackgroundApp are ImageBrush's.

    Rui Peres - C# Fã

    • Edited by ruiperes Sunday, December 8, 2013 9:13 PM
    Sunday, December 8, 2013 8:46 PM
  • Hi Rui,

    That's not enough information to reproduce the problem. There is no scrolling involved in your sample code snippet.

    Can you please give more details about the problem code and exact repro steps with a comparison between the expected and the actual behavior. If you can share a minimal project which reproduces the problem on your SkyDrive that would be a great reference for your repro steps.


    Thursday, December 12, 2013 2:42 AM