private static void CreateStatisticsWindow(object p) { StatisticsWindow curWnd = Application.Current.Windows.OfType<StatisticsWindow>().FirstOrDefault(); if (curWnd == null) { curWnd = new StatisticsWindow(); } curWnd.AddDataFilter(Utils.MapRegionName(p.ToString())); curWnd.UpdateData(); curWnd.Show(); }
private void btnLoadAllData_Click(object sender, RoutedEventArgs e) { string[] regions = Global.Instance.ListOfData.Select((x) => x.Region).Distinct().ToArray(); StatisticsWindow wnd = Application.Current.Windows.OfType <StatisticsWindow>().FirstOrDefault(); if (wnd != null) { wnd.Close(); } wnd = new StatisticsWindow(); foreach (string s in regions) { wnd.AddDataFilter(s); } wnd.UpdateData(); wnd.Show(); }