Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. MyControl mc = new MyControl();
  2. mc.TouchDown += mc_TouchDown;
  3. mc.TouchUp += mc_TouchUp;
  4.  
  5. void mc_TouchDown(object sender, TouchEventArgs e)
  6. {
  7. var mc = (MyControl)sender;
  8. mc.CaptureTouch(e.TouchDevice);
  9. }
  10.  
  11. void mc_TouchUp(object sender, TouchEventArgs e)
  12. {
  13. var mc = (MyControl)sender;
  14. if (mc != null && e.TouchDevice.Captured == mc)
  15. {
  16. //Expand and show button / Collapse and hide button
  17. mc.ReleaseTouchCapture(e.TouchDevice);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement