private void SetChartData(object parm) { if (parm is string str) { if (int.TryParse(str, out int dataSet)) { ChartControl.CreateChartData(dataSet); } } }