PreviewTouchDown on parent doesn't allow child buttons to be clicked.
Posted: 04 Oct 2019, 18:29
I am panning and zooming the canvas. However, in this current setup I cannot click the buttons in the ItemsSource, but they are being highlighted when the mouse is over them. I'm assuming it has something to do with subscribing to the preview events, but I wasn't sure why.
Code: Select all
<Grid Name="OuterParent" Background="Transparent">
<Grid
Name="InnerParent"
RenderTransformOrigin="0.5, 0.5">
<Grid.RenderTransform>
<MatrixTransform />
</Grid.RenderTransform>
<ItemsControl>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Width="100" Height="100" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Grid>
Code: Select all
_outerParent.PreviewTouchDown += OnTouchDown;
_outerParent.PreviewTouchUp += OnTouchUp;
_outerParent.PreviewTouchMove += OnTouchMove;
_outerParent.MouseWheel += OnMouseWheel;