예제 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            band b1 = new band("Beatles", "John, Paul, George, Ringo", 1960);
            band b2 = new band("AC/BC", "Harry, Ronny, Fred", 1980);
            band b3 = new band("StormBorn", "Mary, Molly, Ally", 1990);
            band b4 = new band("Big Star", "Johnny, King, Ban,", 1999);
            band b5 = new band("Alice Cooper", "Alice Cooper", 1970);
            band b6 = new band("Chicago Fire", "Anne, Paul", 1960);

            all_bands.Add(b1);
            all_bands.Add(b2);
            all_bands.Add(b3);
            all_bands.Add(b4);
            all_bands.Add(b5);
            all_bands.Add(b6);

            album a1 = new album("night in sky", 1234, 1990);
            album a2 = new album("moon light sinata", 150, 1999);
            album a3 = new album("jolene", 1200, 1970);
            album a4 = new album("sweet baby james", 1400, 1988);
            album a5 = new album("party in the U.S.A", 1550, 1963);
            album a6 = new album("lucy in the sky with dimoands", 2000, 1968);

            all_albums.Add(a1);
            all_albums.Add(a2);
            all_albums.Add(a3);
            all_albums.Add(a4);
            all_albums.Add(a5);
            all_albums.Add(a6);

            lbxBands.ItemsSource  = all_bands;
            lbxAlbums.ItemsSource = all_albums;
        }
예제 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Random   rng   = new Random();
            RockBand band1 = new RockBand()
            {
                BandName   = "Panic at the disco",
                YearFormed = rng.Next(1950, 2020),
                Members    = "Brendan Uire"
            };

            IndieBand band2 = new IndieBand()
            {
                BandName   = "fall out boy",
                YearFormed = rng.Next(1950, 2020),
                Members    = "tom"
            };

            RockBand band3 = new RockBand()
            {
                BandName   = "linkin park",
                YearFormed = rng.Next(1950, 2020),
                Members    = "mike,chester"
            };
            PopBand band4 = new PopBand()
            {
                BandName   = "genesis",
                YearFormed = rng.Next(1950, 2020),
                Members    = "phil collins,"
            };
            PopBand band5 = new PopBand()
            {
                BandName   = "abba",
                YearFormed = rng.Next(1950, 2020),
                Members    = "tina"
            };
            RockBand band6 = new RockBand()
            {
                BandName   = "Queen",
                YearFormed = rng.Next(1950, 2020),
                Members    = "freddy"
            };

            Bands.Add(band1);
            Bands.Add(band2);
            Bands.Add(band3);
            Bands.Add(band4);
            Bands.Add(band5);
            Bands.Add(band6);


            album album1 = new album()
            {
                AlbumName = "abcd",
                Released  = RandomDate(),
                Sales     = rng.Next(10, 30)
            };
            album album2 = new album()
            {
                AlbumName = "tyui",
                //Released = rng.Next(1960,2020),
                Released = RandomDate(),
                Sales    = rng.Next(10, 30)
            };
            album album3 = new album()
            {
                AlbumName = "aeiou",
                //Released = rng.Next(1960,2020),
                Released = RandomDate(),
                Sales    = rng.Next(10, 30)
            };
            album album4 = new album()
            {
                AlbumName = "qwerty",
                //Released = rng.Next(1960,2020),
                Released = RandomDate(),
                Sales    = rng.Next(10, 30)
            };
            album album5 = new album()
            {
                AlbumName = "asdf",
                //Released = rng.Next(1960,2020),
                Released = RandomDate(),
                Sales    = rng.Next(10, 30)
            };
            album album6 = new album()
            {
                AlbumName = "awsd",
                //Released = rng.Next(1960,2020),
                Released = RandomDate(),
                Sales    = rng.Next(10, 30)
            };

            Albums.Add(album1);
            Albums.Add(album2);
            Albums.Add(album3);
            Albums.Add(album4);
            Albums.Add(album5);
            Albums.Add(album6);

            RefreshList();
            lbxBand.ItemsSource  = Bands;
            cbxGenre.ItemsSource = new string[] { "All", "Indie", "Pop", "Rock" };
        }