PreviewTouchDown on parent doesn't allow child buttons to be clicked.
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;-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: PreviewTouchDown on parent doesn't allow child buttons to be clicked.
Are you setting e.Handled = true on the PreviewTouchDown handler?
Because that will stop the routing of touch down event down the tree, making impossible to click the buttons.
I just verified that not setting e.Handled allows you to correctly click the inner buttons.
Because that will stop the routing of touch down event down the tree, making impossible to click the buttons.
I just verified that not setting e.Handled allows you to correctly click the inner buttons.
Who is online
Users browsing this forum: No registered users and 5 guests