0
我想要在我的實際內容後面移動視差移動圖像的背景。我已經根據約翰的解決方案添加了一個轉換器: http://w8isms.blogspot.com/2012/09/parallax-background-in-xaml-revisited.html當滾動回屏幕時,應用程序屏幕外的項目被切斷
視差滾動的部分工作正常,雖然我已經在如下問題絆倒 - 圖像初始應用程序的屏幕面積之外得到切斷,所以當我滾動正確的,只有白色區域開始出現,而不是其他圖像,因爲在那些內容將不得不重繪。有人知道我能做些什麼來解決它嗎?
這是我的代碼:
<Grid Background="White">
<StackPanel Orientation="Horizontal">
<StackPanel.RenderTransform>
<CompositeTransform
TranslateX="{Binding ElementName=MyScrollViewer, Path=HorizontalOffset, Converter={StaticResource ParallaxConverter}}" />
</StackPanel.RenderTransform>
<Image Source="1.jpg"/>
<Image Source="2.jpg"/>
<Image Source="3.jpg"/>
</StackPanel>
<ScrollViewer
x:Name="MyScrollViewer"
HorizontalScrollMode="Enabled"
HorizontalScrollBarVisibility="Auto">
<TextBlock
VerticalAlignment="Center"
FontSize="180"
Text="Hello world! This text will extend to the right." />
</ScrollViewer>
</Grid>