MultiScaleImage renders on top of title pane

249 Views Asked by At

My program uses a MultiScaleImage in a ScrollViewer on wp7.5, along with other contents. The problem I'm having is when I try to scroll, the image renders on top of the title pane instead of going "under" it, while all other contents are rendered under the title pane (cuts off by title pane, the correct behaviour)

Does anyone know if this is a known issue, or am I doing something wrong?

in xaml:

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <ScrollViewer>
        <StackPanel>
            <Button>LOL</Button>
            <Grid x:Name="RootGrid" Width="420" Height="374">
                <MultiScaleImage x:Name="MSI"></MultiScaleImage>
            </Grid>
            <Button>LOL</Button>
            <Button>LOL</Button>
            <Button>LOL</Button>
            <Button>LOL</Button>
            <Button>LOL</Button>
            <Button>LOL</Button>
            <Button>LOL</Button>
        </StackPanel>
    </ScrollViewer>
</Grid>

code behind:

public partial class MainPage : PhoneApplicationPage
{
    public MainPage()
    {
        InitializeComponent();
        this.Loaded += new System.Windows.RoutedEventHandler(MainPage_Loaded);
    }

    void MainPage_Loaded(object sender, System.Windows.RoutedEventArgs e)
    {
        this.MSI.Source = new TileSource();
    }
}

public class TileSource : MultiScaleTileSource
{
    public TileSource() :
        base(256, 256, 256, 256, 0)
    {
    }

    protected override void GetTileLayers(int tileLevel, int tilePositionX, int tilePositionY, System.Collections.Generic.IList<object> tileImageLayerSources)
    {
        tileImageLayerSources.Add(new System.Uri(@"someurl"));
    }
}

Setting the Z-order of everything else to a very high value along with a solid color background seems to work, but that is not feasible in my current project since we are using a view with an image as background, having a solid color title pane will cover up the background.

Thanks for your help!

0

There are 0 best solutions below