C# 多尺度图像在标题窗格顶部呈现
我的程序在wp7.5上的ScrollViewer中使用多尺度图像以及其他内容。我遇到的问题是,当我尝试滚动时,图像呈现在标题窗格的顶部而不是下方,而所有其他内容都呈现在标题窗格下,被标题窗格截断,这是正确的行为 有人知道这是一个已知的问题,还是我做错了什么 在xaml中:C# 多尺度图像在标题窗格顶部呈现,c#,silverlight,windows-phone-7,xaml,multiscaleimage,C#,Silverlight,Windows Phone 7,Xaml,Multiscaleimage,我的程序在wp7.5上的ScrollViewer中使用多尺度图像以及其他内容。我遇到的问题是,当我尝试滚动时,图像呈现在标题窗格的顶部而不是下方,而所有其他内容都呈现在标题窗格下,被标题窗格截断,这是正确的行为 有人知道这是一个已知的问题,还是我做错了什么 在xaml中: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <ScrollViewer> <StackPane
<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>
代码隐藏:
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"));
}
}
将所有其他内容的Z顺序与纯色背景一起设置为非常高的值似乎是可行的,但在我当前的项目中,这是不可行的,因为我们使用的是以图像为背景的视图,使用纯色标题窗格将掩盖背景
谢谢你的帮助 你能解释一下为什么改变Z顺序是不可行的吗?也许添加屏幕截图会有所帮助…抱歉,忘了提及单独设置Z顺序并不能解决问题,我不得不将标题窗格的背景也更改为纯色,而不是透明。问题是,我使用的视图以图像为背景,标题窗格中的纯色背景也会覆盖图像背景。