public MainWindow()
        {
            InitializeComponent();

            heroes = Superheroe.GetSamples();
            BindingDelObjeto(1);
            ActualizaIndice(1);
        }
 public void BindingDelObjeto(int indice)
 {
     indice--;
     pestaña1DockPanel.DataContext = heroes[indice];
     heroe = new Superheroe();
     pestaña2Grid.DataContext = heroe;
     heroe.Heroe = true;
 }
Beispiel #3
0
        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);
        }
 private void LimpiarFormulario()
 {
     heroe = new Superheroe();
     pestaña2Grid.DataContext = heroe;
     heroe.Heroe = true;
 }