Scrollviewer scales only one item

I need to enlarge the image in the uwp application, which works fine, but for the design, I need to have another image (which works like a button) in front of it, and I do not want this element to increase as well. It should be just the image inside the canvas tag, that's how I am now.

<ScrollViewer MinZoomFactor="1" ZoomMode="Enabled" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> <RelativePanel HorizontalAlignment = "Stretch" > <Canvas x:Name="canvas"> <Image Source = "{Binding Test,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" /> </Canvas > <Button RelativePanel.AlignTopWithPanel="True" Height="55" Command="{Binding Path=CollapseSplitView}" CommandParameter="{Binding ElementName=SplitV}"> <Button.Background> <ImageBrush ImageSource = "/Assets/btlist.png" ></ ImageBrush > </Button.Background > </Button > <Image RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignRightWithPanel="True" Source="/Assets/escala-x.png" Width="130" Height="70" Margin="0,0,20,0" ScrollViewer.IsZoomChainingEnabled="False" ScrollViewer.IsZoomInertiaEnabled="False"> </Image> </RelativePanel> </ScrollViewer> 

thats xaml i have and does the scaling job for all elements inside it. I tried setting scrollViewer.zoomMode = disabled for elements that are not on the canvas but with no luck. Any ideas? Thanks!

+5
source share
1 answer

I finally fixed this by adding a scrollViewer inside a RelativePanel, and then wrap the content that I would like to enlarge inside the StackPanel and then the Grid to have some elements inside. Thank you all

+4
source

Source: https://habr.com/ru/post/1269620/


All Articles