コード例 #1
0
        private void _flexChart_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            if (ContentEditor == null || SelectedAnnotation == null)
            {
                return;
            }

            var financialChart = sender as C1.Xaml.Chart.Finance.C1FinancialChart;
            var point          = e.GetPosition(financialChart);

            if (HitTest(point) == this.SelectedAnnotation && SelectedAnnotation.IsEditable())
            {
                Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 0);
                ShowContentEditor(this.SelectedAnnotation, e.GetPosition((Window.Current.Content as Frame).Content as MainPage));
            }
        }
        private void OnMouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (ContentEditor == null || SelectedAnnotation == null)
            {
                return;
            }

            if (this.HitTest(e.Location) == this.SelectedAnnotation && SelectedAnnotation.IsEditable())
            {
                ShowContentEditor(this.SelectedAnnotation, e.Location);
            }
            else
            {
                HideContentEditor();
            }
        }
コード例 #3
0
        private void OnMouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (ContentEditor == null || SelectedAnnotation == null)
            {
                return;
            }

            //Show Annotation Editor
            if (this.HitTest(e.GetPosition(FlexChart)) == this.SelectedAnnotation && SelectedAnnotation.IsEditable())
            {
                var mainWindow = ((System.Windows.Window)(((System.Windows.FrameworkElement)FlexChart.Parent).Parent));
                ShowContentEditor(this.SelectedAnnotation, e.GetPosition(Application.Current.MainWindow));
            }
            else
            {
                HideContentEditor();
            }
        }
コード例 #4
0
        private void OnMouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (SelectedAnnotation == null)
            {
                return;
            }

            if (this.HitTest(e.Location) == this.SelectedAnnotation && SelectedAnnotation.IsEditable())
            {
                using (frmAnnotation frm = new frmAnnotation(this.SelectedAnnotation))
                {
                    frm.BuildForm();
                    frm.StartPosition = FormStartPosition.Manual;
                    frm.Location      = Chart.PointToScreen(MainForm.AdjustPosition(e.Location, frm.Size, Chart));
                    frm.ShowDialog();
                }
            }
        }
コード例 #5
0
        private void OnMouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (ContentEditor == null || SelectedAnnotation == null)
            {
                return;
            }

            //Show Annotation Editor
            if (this.HitTest(e.GetPosition(FlexChart)) == this.SelectedAnnotation && SelectedAnnotation.IsEditable())
            {
                var mainWindow = (System.Windows.Window)FindParentWindow(FlexChart.Parent, typeof(Window));
                if (mainWindow != null)
                {
                    ShowContentEditor(this.SelectedAnnotation, e.GetPosition(mainWindow));
                }
            }
            else
            {
                HideContentEditor();
            }
        }
コード例 #6
0
        public void Dispose()
        {
            RemoveAllMarkers();

            if (_focusOnSeekiosButton != null)
            {
                _focusOnSeekiosButton.Dispose();
            }
            if (_focusOnZoneButton != null)
            {
                _focusOnZoneButton.Dispose();
            }
            if (_zoomInButton != null)
            {
                _zoomInButton.Dispose();
            }
            if (_zoomOutButton != null)
            {
                _zoomOutButton.Dispose();
            }
            if (_editZoneButton != null)
            {
                _editZoneButton.Dispose();
            }
            if (_undoButton != null)
            {
                _undoButton.Dispose();
            }
            if (_accuracyArea != null)
            {
                _accuracyArea.Dispose();
            }
            if (_mapDelegate != null)
            {
                _mapDelegate.Dispose();
            }
            if (_controller != null)
            {
                _controller.Dispose();
            }
            if (MapViewControl != null)
            {
                MapViewControl.MapType  = MKMapType.Hybrid;
                MapViewControl.Delegate = null;
                MapViewControl.RemoveFromSuperview();
                MapViewControl = null;
                MapViewControl.Dispose();
            }

            if (SelectedAnnotation != null)
            {
                SelectedAnnotation.Dispose();
            }
            if (SelectedLocationHistory != null)
            {
                SelectedLocationHistory.Dispose();
            }
            if (SelectedPointsOfRoute != null)
            {
                SelectedPointsOfRoute.Dispose();
            }
            if (RoutePolyline != null)
            {
                RoutePolyline.Dispose();
            }
            PointsOfRoute.Clear();
            PointsOfRoute = null;
        }
コード例 #7
0
        private void _flexChart_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var ms = stopwatch.ElapsedMilliseconds;

            stopwatch.Reset();
            if (ms <= 100)
            {
                if (ContentEditor == null || SelectedAnnotation == null)
                {
                    return;
                }
                //Show Annotation Editor
                if (HitTest(e.GetCurrentPoint(FlexChart).Position) == SelectedAnnotation && SelectedAnnotation.IsEditable())
                {
                    ShowContentEditor(this.SelectedAnnotation, e.GetCurrentPoint((Window.Current.Content as Frame).Content as MainPage).Position);
                }
            }
            else if (ms > 100)
            {
                HideContentEditor();
                _drawing = false;

                var pos = e.GetCurrentPoint(FlexChart).Position;
                SelectedAnnotation = HitTest(pos);

                if (AllowMove && SelectedAnnotation != null && e.GetCurrentPoint((UIElement)sender).Properties.IsLeftButtonPressed)
                {
                    _oldPoint   = pos;
                    _isDragging = true; //Start Dragging
                    Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.SizeAll, 1);
                }
                else
                {
                    var ht = FlexChart.HitTest(e.GetCurrentPoint(FlexChart).Position);
                    if (AllowAdd && e.GetCurrentPoint((UIElement)sender).Properties.IsLeftButtonPressed)
                    {
                        _start = pos;
                        if (NewAnnotationType == typeof(Text))
                        {
                            AddAnnotation(_start, e);
                            FlexChart.Invalidate();
                        }
                    }
                    else
                    {
                        SelectedAnnotation = null;
                        _flexChart.Invalidate();
                    }
                }
            }
            stopwatch.Start();
        }