Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello Everyone,

This is my xaml

<canvas x:name="canvas" Button.click = "Somefunction">

</canvas>


So I have a User control with 2 rows in a grid, I have a canvas in 2nd row. Well, I am dynamically creating buttons and adding them as a children to the canvas. Now, at present, when any button present in canvas is clicked, this somefunction which i have defined in code behind will be invoked.

Now, What I want is, I want to select 2 buttons, but, selection should happen on long press of the one button followed by long press of the second button. Once, both are selected, I want to execute my own code.

How to code long press button selection on the dynamically created,attached buttons in the canvas explained as above. I found some links in the stackoverflow and codeproject. But, That really didnt gave me proper idea on how to go about with the present xaml and programmed logic. Hence, Please suggest on this, with basis to the above xaml structure and explained logic of program.

Thank you,

Rakesh.N
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900