public MainWindow()
 {
     superheroes = Superheroe.GetSamples();
     Indice      = 0;
     InitializeComponent();
     ActualizaContador();
 }
Exemplo n.º 2
0
 public MainWindow()
 {
     InitializeComponent();
     superheroes            = Superheroe.GetSamples();
     contenedor.DataContext = superheroes;
     actualTextBlock.Text   = "1";
     totalTextBlock.Text    = superheroes.Count.ToString();
     superheroe             = new Superheroe();
     contenedorNuevoSuperheroe.DataContext = superheroe;
 }
Exemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();

            superheroe = new Superheroe
            {
                // Marcamos predeterminado el RadioButton de Héroe
                Heroe = true
            };
            superheroes = Superheroe.GetSamples();
            ActualizaVista(cambiaPag.actual);
            nuevoSuperheroe.DataContext = superheroe;
        }
        public static List <Superheroe> GetSamples()
        {
            List <Superheroe> ejemplos = new List <Superheroe>();

            Superheroe ironman   = new Superheroe("Ironman", @"https://sm.ign.com/ign_latam/screenshot/default/ybbpqktez5whedr0-1592031889_31aa.jpg", true, false, true, false);
            Superheroe kingpin   = new Superheroe("Kingpin", @"https://www.comicbasics.com/wp-content/uploads/2017/09/Kingpin.jpg", false, false, false, true);
            Superheroe spiderman = new Superheroe("Spiderman", @"https://wipy.tv/wp-content/uploads/2019/08/destino-de-%E2%80%98Spider-Man%E2%80%99-en-los-Comics.jpg", true, true, true, false);

            ejemplos.Add(ironman);
            ejemplos.Add(kingpin);
            ejemplos.Add(spiderman);

            return(ejemplos);
        }
Exemplo n.º 5
0
        private void AceptarButton_Click(object sender, RoutedEventArgs e)
        {
            superheroes.Add(superheroe);

            // Mensaje con icono
            MessageBox.Show("Superhéroe insertado con éxito",
                            "Superhéroes",
                            MessageBoxButton.OK,
                            MessageBoxImage.Information);

            ActualizaVista(cambiaPag.actual);
            superheroe = new Superheroe
            {
                // Marcamos predetirmado el RadioButton de Heroe
                Heroe = true
            };
            nuevoSuperheroe.DataContext = superheroe;
        }
Exemplo n.º 6
0
 private void aceptarButton_Click(object sender, RoutedEventArgs e)
 {
     superheroe.Nombre = nombreTextBox.Text;
     superheroe.Imagen = rutaImagenTextBox.Text;
     if ((bool)villanoRadioButton.IsChecked)
     {
         superheroe.Vengador = false;
         superheroe.Xmen     = false;
         superheroe.Heroe    = false;
     }
     else
     {
         superheroe.Vengador = (bool)vengadoresCheckBox.IsChecked;
         superheroe.Xmen     = (bool)xmenCheckBox.IsChecked;
         superheroe.Heroe    = true;
         superheroe.Villano  = false;
     }
     superheroes.Add(superheroe);
     MessageBox.Show("Superhéroe insertado con exito", "Superhéroes", MessageBoxButton.OK, MessageBoxImage.Information);
     totalTextBlock.Text = superheroes.Count.ToString();
     superheroe          = new Superheroe();
     contenedorNuevoSuperheroe.DataContext = superheroe;
 }
Exemplo n.º 7
0
 private void limpiarButton_Click(object sender, RoutedEventArgs e)
 {
     superheroe = new Superheroe();
     contenedorNuevoSuperheroe.DataContext = superheroe;
 }