Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScatterViewItems Containing Surface Interactive Elements

This is an age old problem of interactive elements inside interactive elements, but I want a ScatterViewItem to contain other surface interactive elements such as a SurfaceButton or SurfaceCheckBox. I've got all my elements in there and they react to taps etc. The problem is that I only get the normal ScatterView behavior once I click on an area that does not contain a control.

Is there an elegant solution to allow dragging even when the contact is on a SurfaceButton or SurfaceCheckbox?

e.g.

<s:ScatterView >    
    <Grid Width="200" Height="200">
        <s:SurfaceButton />
    </Grid>
</s:ScatterView>
like image 251
James Hay Avatar asked Nov 14 '22 15:11

James Hay


1 Answers

After asking the same question on the surface community forums, the response was that this is consistent with all WPF control behavior. For instance if you add interactive elements to a list box, the ListBox will not react to interactions when the mouse is over the button.

If anyone else comes across this problem, it is probably best to solve this problem through the design of the control rather than trying to hack this behavior together. Control behavior should remain consistent from one app to another and one control to another.

like image 81
James Hay Avatar answered Dec 23 '22 09:12

James Hay