Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Wierd scrollviewer margin

$
0
0

Dear all,

I have a simple scroll viewer which allows me to slide to different content area with page size of 1920 as width.

<ScrollViewer Grid.RowSpan="3"  x:Name="_mainHScrollViewer" ScrollChanged="_mainHScrollViewer_ScrollChanged"
                      PreviewTouchUp="_mainHScrollViewer_PreviewTouchUp"  Padding="0"
                       Width="{Binding ElementName=Main, Path=Width}" PanningMode="HorizontalOnly" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
                       Visibility="{Binding KinectConnected,UpdateSourceTrigger=PropertyChanged,Converter={StaticResource VisibilityConverter}}"><StackPanel x:Name="_pannel" Orientation="Horizontal" HorizontalAlignment="Center" ><Viewbox HorizontalAlignment="Center" ><Image x:Name="_ColorSource"  VerticalAlignment="Center"
                        Stretch="UniformToFill" RenderTransformOrigin="0.5,0.5" ><Image.RenderTransform><ScaleTransform ScaleX="-1"/></Image.RenderTransform></Image></Viewbox><Viewbox Width="1920" Height="1080" ><Image x:Name="_IrSource"  VerticalAlignment="Center" HorizontalAlignment="Center"
                        Stretch="UniformToFill" RenderTransformOrigin="0.5,0.5" ><Image.RenderTransform><ScaleTransform ScaleX="-1"/></Image.RenderTransform></Image></Viewbox></StackPanel></ScrollViewer>

While I am scrolling to next page either with cursor or touch, I ama wierd letf area as shown below

This area correspond to an area of my first page. what I could notice from the Cursor position of the scroll viewer is that it gets a max value of 1906 instead of 1920. If I move the scrollviewer with touch to the right side it is positionning correctly but when releasing touch, it slide back

Any idea how to remove this offset? is it the place reserved for vertical scroolbar even if they are set to hidden ?

Thanks for tips


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>