private void UILoadDataSet(DataSet clientsData) { this.Clients.Children.Clear(); if (clientsData.NumberOfRows() != 0) { bool doneBuilders = false; while (clientsData.Read()) { Client client = new Client(clientsData.GetRecordDataSet()); TextBlock block = new TextBlock(); block.Text = client.GetName(); block.Name = "Client" + client.GetClientID(); clientsTable.Add(block.Name, client); Color forground = new Color(); forground.ScA = 1; forground.ScR = 1; forground.ScG = 1; forground.ScB = 1; block.Foreground = new SolidColorBrush(forground); block.FontSize = 14; block.MouseEnter += TextBlock_MouseEnter; block.MouseLeave += TextBlock_MouseLeave; block.MouseDown += TextBlock_DoubleClick; if (!doneBuilders & client.GetClientType() == 1) { Thickness padding = new Thickness(); padding.Top = 15; block.Padding = padding; doneBuilders = true; } this.Clients.Children.Add(block); } } else { MessageBox.Show("There are currently no clients in the System. Please create a client.", "No Clients Exist!", MessageBoxButton.OK, MessageBoxImage.Error); MainWindow.RemoveTab(this.Name); } }