public ShowPlayers(ServiceClient client, string username) { InitializeComponent(); Client = client; Username = username; try { Players = Client.GetUsers();//call the function GetUsers to get all the users if (Players.Count > 0) { var IS = from p in Players select p.Key + ", Points: " + p.Value["Points"] + " Games: " + p.Value["GamesCounter"] + " Wins: " + p.Value["WonCounter"] + " Losses: " + p.Value["Losses"]; LBox1.ItemsSource = IS; LBox2.ItemsSource = IS; } else { LBox1.Items.Clear(); LBox2.Items.Clear(); LBox1.Items.Add("Players table empty"); LBox2.Items.Add("Players table empty"); } } catch (TimeoutException) { MessageBox.Show(" connection unstable , it took to long to get a response, unable to connect try again later", username + " connection unstable"); this.Close(); } catch (CommunicationObjectFaultedException) { MessageBox.Show(" connection unstable , it took to long to get a response, unable to connect try again later", username + " connection unstable"); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message, Username); this.Close(); } }