private async void ChartMouseClick(object sender, MouseEventArgs e) { if (manager == null) { return; } if (e.Button == MouseButtons.Right) { manager.DrillUp(); } else { var flexChart = sender as FlexChartBase; var hitInfo = flexChart.HitTest(new Point(e.X, e.Y)); if (hitInfo != null && hitInfo.Distance < 2) { _currentValue = hitInfo.X; var tooltip = flexChart.ToolTip.Content; flexChart.ToolTip.Content = "Please wait while the details are being fetched"; flexChart1.Cursor = Cursors.WaitCursor; Console.WriteLine("Start fetching details"); IEnumerable <object> data = await FetchDataAsync(manager.DrillDownLevel); flexChart.Enabled = true; Console.WriteLine("Fetching details completed"); flexChart.ToolTip.Hide(flexChart1); flexChart.ToolTip.Content = tooltip; flexChart1.Cursor = Cursors.Default; manager.DrillDown(data); } } }
private void AddToNavBar(Type control, string text, int level = -1) { Control lbl = (Control)Activator.CreateInstance(control); lbl.Text = text; lbl.Margin = new Padding(0); lbl.Padding = new Padding(0); lbl.AutoSize = true; if (lbl is LinkLabel) { var link = lbl as LinkLabel; link.LinkClicked += (s, e) => manager.DrillUp(level); } pnlNavBar.Controls.Add(lbl); }