下記に書いてあるようなItemsPanelTemplateの中のCanvasを参照してCanvasを操作する方法が分かりません。
どなたか教えていただければ助かります。
よろしくお願いします。
<ScrollViewer x:Name="scrollViewer" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" PreviewMouseWheel="scrollViewer_PreviewMouseWheel"> <ItemsControl x:Name="_ItemsControl" ItemsSource="{Binding Path=Lines}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas x:Name="_Canvas" Background="White" Width="10000" Height="10000" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Line X1="{Binding X1}" Y1="{Binding Y1}" X2="{Binding X2}" Y2="{Binding Y2}" Stroke="{Binding LineColor}" StrokeThickness="3" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </ScrollViewer>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/05/20 03:48