gpt4 book ai didi

wpf - ItemsControl中的Adorner

转载 作者:行者123 更新时间:2023-12-03 10:57:15 25 4
gpt4 key购买 nike

我在ItemsControl中使用Canvas,可以在其中绘制矩形,圆形等形状。我要调整大小并移动绘制的形状。我尝试使用装饰器,但没有找到在ItemsControl中使用装饰器的方法,这可能吗?

                <ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<zc:ZoomableCanvas Loaded="Canvas_Loaded"
RealizationLimit="1000"
RealizationRate="10"
RealizationPriority="Background"
ApplyTransform="False"
Scale="{Binding ZoomableCanvas.Scale}"
Offset="{Binding ZoomableCanvas.Offset}" ClipToBounds="True"
Width="{Binding ZoomableCanvas.ActualWidth}"
Height="{Binding ZoomableCanvas.ActualHeight}"
>
</zc:ZoomableCanvas>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

最佳答案

答案可能有点晚了,但是我还是写了它以备将来引用。

如果您使用的Canvas位于AdornerDecorator中,则只能显示装饰物。试试这个:

<AdornerDecorator>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<zc:ZoomableCanvas Loaded="Canvas_Loaded"
RealizationLimit="1000"
RealizationRate="10"
RealizationPriority="Background"
ApplyTransform="False"
Scale="{Binding ZoomableCanvas.Scale}"
Offset="{Binding ZoomableCanvas.Offset}"
ClipToBounds="True"
Width="{Binding ZoomableCanvas.ActualWidth}"
Height="{Binding ZoomableCanvas.ActualHeight}"
>
</zc:ZoomableCanvas>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</AdornerDecorator>

我希望这有帮助!

关于wpf - ItemsControl中的Adorner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46417894/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com