protected override void OnTouchUp(TouchEventArgs e) { if (TouchCapture.Captured == this) { TouchCapture.ReleaseCapture(); } }
protected override void OnTouchMove(TouchEventArgs e) { if (TouchCapture.Captured == this && !ContainsScreenPoint(e.Point)) { TouchCapture.ReleaseCapture(); Invalidate(); } }
public HomePage() : base(0, 0, DemoManager.Desktop.Width, DemoManager.Desktop.Height) { panelNavigation = new Panel(5, 5, DemoManager.Desktop.Width - 10, DemoManager.Desktop.Height - 10) { Background = new LinearGradientBrush(Color.Bisque, Color.Black, 0, 0, 1000, 1000, 120), Border = new Pen(Color.Black, 1) }; Children.Add(panelNavigation); header = new Panel(0, 0, panelNavigation.Width - 0, 25); header.Background = DemoManager.Bar; header.Children.Add(new Label(10, 5, DemoManager.FontCourierNew10, "Navigation") { ForeColor = Color.CornflowerBlue }); header.TouchDown += delegate(object sender, TouchEventArgs e) { TouchCapture.Capture(header); p = e.Point; }; header.TouchMove += delegate(object sender, TouchEventArgs e) { if (TouchCapture.Captured == header) { panelNavigation.Translate(e.Point.X - p.X, e.Point.Y - p.Y); p = e.Point; } }; header.TouchUp += delegate(object sender, TouchEventArgs e) { if (TouchCapture.Captured == header) { TouchCapture.ReleaseCapture(); } }; panelNavigation.Children.Add(header); x = margin; w = panelNavigation.Width / 2 - 2 * margin; y = header.Height + margin; step = h + margin; AddButton("Level"); AddButton("ProgressBar"); AddButton("Image"); //AddButton("Panel"); //AddButton("Checkbox"); //AddButton("Button"); //AddButton("MultiImage"); //AddButton("Label"); //AddButton("RadioButton"); //AddButton("Slider"); //AddButton("TextBlock"); //AddButton(""); //AddButton(""); //AddButton(""); //AddButton(""); //AddButton(""); //AddButton(""); }
protected override void OnTouchUp(TouchEventArgs e) { if (TouchCapture.Captured == this) { TouchCapture.ReleaseCapture(); Invalidate(); if (ContainsScreenPoint(e.Point)) { NotifyClick(EventArgs.Empty); } } }