private void SketchCanvasPointerMoved(object sender, global::Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed == false)
            {
                return;
            }

            var newPoint = e.GetCurrentPoint(this).Position;

            var line = new Line()
            {
                X1 = oldPoint.X,
                Y1 = oldPoint.Y,
                X2 = newPoint.X,
                Y2 = newPoint.Y,
                StrokeThickness = 2.0,
                Stroke          = brush
            };

            oldPoint = newPoint;

            Children.Add(line);

            LineDrawn?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Provides class handling for the MouseLeftButtonDown event that
        /// occurs when the left mouse button is pressed while the mouse pointer
        /// is over this control.
        /// </summary>
        /// <param name="e">The event data. </param>
        /// <exception cref="System.ArgumentNullException">
        /// e is a null reference (Nothing in Visual Basic).
        /// </exception>
        /// <remarks>
        /// This method marks the MouseLeftButtonDown event as handled by
        /// setting the PointerRoutedEventArgs.Handled property of the event data
        /// to true when the button is enabled and its ClickMode is not set to
        /// Hover.  Since this method marks the MouseLeftButtonDown event as
        /// handled in some situations, you should use the Click event instead
        /// to detect a button click.
        /// </remarks>
        protected override void OnPointerPressed(global::Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            base.OnPointerPressed(e);

            EventHandler <PointerRoutedEventArgs> handler = CalendarButtonMouseDown;

            if (null != handler)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 3
0
        //void IndicatorSource1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        //{
        //    var indicator = Addindicator((string)IndicatorSource1.SelectedItem, 0);
        //    if (indicator != null)
        //    {
        //        indicatorsCollection.Add(indicator);
        //        foreach (var item in indicatorsCollection)
        //        {
        //            ISupportAxes indicatorAxis = item as ISupportAxes;
        //            if (this.ChartArea.TechnicalIndicators.Contains(item))
        //            {
        //                var index = SfChart.GetRow(indicatorAxis.ActualYAxis);
        //                if (index == 1)
        //                {
        //                    this.ChartArea.TechnicalIndicators.Remove(item);
        //                    rmIndexes.Add(indicatorsCollection.IndexOf(item));
        //                }
        //            }
        //            else
        //            {
        //                var index = SfChart.GetRow(indicatorAxis.ActualYAxis);
        //                if (index == 1)
        //                {
        //                    NumericalAxis axis = new NumericalAxis();
        //                    axis.OpposedPosition = true;
        //                    axis.Visibility = Visibility.Collapsed;
        //                    indicatorAxis.YAxis = axis;
        //                    SfChart.SetRow(indicatorAxis.YAxis, 1);
        //                    this.ChartArea.TechnicalIndicators.Add(item);
        //                }
        //            }
        //        }
        //        foreach (var item in rmIndexes)
        //        {
        //            indicatorsCollection.RemoveAt(item);
        //        }
        //        rmIndexes.Clear();
        //    }
        //}


        protected override void OnPointerReleased(global::Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            base.OnPointerReleased(e);
            //  this.IndicatorSource1.Visibility = Visibility.Visible;
            this.IndicatorSource2.Visibility = Visibility.Visible;
        }
Ejemplo n.º 4
0
 protected virtual void OnPointerWheelChanged(global::Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Xaml.Controls.Control", "void Control.OnPointerWheelChanged(PointerRoutedEventArgs e)");
 }
 private void SketchCanvasPointerPressed(object sender, global::Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     oldPoint = e.GetCurrentPoint(this).Position;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Handler for the ScrollViewer's PointerPressed event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Scroller_PointerPressed(object sender, global::Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     // Expect a DirectManipulationStarted event only when a touch pointer is seen.
     m_pointerPressed |= e.Pointer.PointerDeviceType == global::Windows.Devices.Input.PointerDeviceType.Touch;
 }