2017-09-26 12 views
0

私は、矩形、円などの図形を描画できるItemsControl内でCanvasを使用しています。描画された図形のサイズを変更して移動したい。私はアドボナーを使ってみましたが、ItemsControlの中で飾り文字を使う方法を見つけられませんでしたが、これは可能ですか?Adorner in 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> 

答えて

1

答えが少し遅れているかもしれませんが、それでも私は将来の参考のために書きます。

あなたが使用している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> 

関連する問題