mar*_*014 5 c# xaml scrollview uwp uwp-xaml
我必须在uwp应用程序中缩放图像,它工作正常,但设计需要在它前面有另一个图像(用作按钮),我也不希望该元素也被缩放.它必须只是canvas标签内的图像,这就是我现在拥有它的方式.
<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>
Run Code Online (Sandbox Code Playgroud)
这就是我拥有的xaml,它使缩放适用于其中的所有元素.我试图为不在画布中但没有运气的元素设置scrollViewer.zoomMode = disabled.有任何想法吗?谢谢!
我最终通过在RelativePanel中添加一个scrollViewer来修复它,然后将我想要缩放的内容包装在StackPanel中,然后包装在Grid中以便能够在其中包含多个元素。谢谢大家
归档时间: |
|
查看次数: |
223 次 |
最近记录: |