private async void OnMouseDown(object sender, MouseButtonEventArgs e) { if (_vm.IsBusy) { return; } if (e.LeftButton == MouseButtonState.Pressed) { var pos = e.GetPosition(flexChart); var hitInfo = flexChart.HitTest(pos); if (hitInfo != null && hitInfo.Distance < 2) { _currentValue = hitInfo.X; tbWaitMessage.Text = "Please wait while the details are being fetched"; flexChart.Cursor = Cursors.Wait; Console.WriteLine("Start fetching details"); IEnumerable <object> data = await _vm.FetchDataAsync(_vm.AsyncDrillDownManager.DrillDownLevel, _currentValue); Console.WriteLine("Fetching details completed"); tbWaitMessage.Text = ""; flexChart.Cursor = Cursors.Arrow; _vm.AsyncDrillDownManager.DrillDown(data); } } }
private async void flexChart_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) { if (_vm.IsBusy) { return; } if (e.GetCurrentPoint(flexChart).Properties.IsLeftButtonPressed) { var pos = e.GetCurrentPoint(flexChart); var hitInfo = flexChart.HitTest(pos.Position); if (hitInfo != null && hitInfo.Distance < 2) { _currentValue = hitInfo.X; tbWaitMessage.Text = Strings.WaitMessage; Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1); Debug.WriteLine("Start fetching details"); IEnumerable <object> data = await _vm.FetchDataAsync(_vm.AsyncDrillDownManager.DrillDownLevel, _currentValue); Debug.WriteLine("Fetching details completed"); tbWaitMessage.Text = ""; Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 2); _vm.AsyncDrillDownManager.DrillDown(data); } } flexChart.Invalidate(); }