public AddShowWindow() { InitializeComponent(); List <Performer> performers = CircusInformation.GetPerformers(); Performers_ListBox.ItemsSource = performers; }
public PerformersWindow() { InitializeComponent(); List <Performer> performers = CircusInformation.GetPerformers(); Performers_ComboBox.ItemsSource = performers; Performers_ComboBox.SelectionChanged += new SelectionChangedEventHandler(Performers_ComboBox_SelectionChanged); int nbOfPerformers = performers.Count; Random rdm = new Random(); int indexAlea = rdm.Next(0, nbOfPerformers); PerformerName_TextBlock.Text = performers[indexAlea].Name; PerformerDescription_TextBlock.Text = performers[indexAlea].Descritpion; BitmapImage bi3 = new BitmapImage(); bi3.BeginInit(); bi3.UriSource = new Uri(performers[indexAlea].Image, UriKind.Relative); bi3.EndInit(); Image_Performers.Source = bi3; }