public VMWrapper(Dron d, Paquete p, int t, int obj, int totalObj, double x, double y) { Dron = new VMDron(d); Paquete = new VMPaquete(p); Time = t; Objectives = obj; TotalObjectives = totalObj; x_ = x; y_ = y; destinos = new int[totalObj]; }
//solo pone en el mapa el ultimo en haber sido clicado, si tienes todos seleccionados solo pilla el ultimo que hayas pulsado private void ImageListView_ItemClickPaquete(object sender, ItemClickEventArgs e) { VMPaquete d = e.ClickedItem as VMPaquete; //SelImaPaquete.Source = d.Img.Source; //TextInfoPaquete.Text = d.Explicacion; ImgFormaPaquete.Source = d.Img.Source; TextPaqueteNombre.Text = d.Nombre; TextPaqueteForma.Text = d.Forma; SelImaPaquete.Source = d.Img.Source; ImgPesoPaquete.Source = d.ImgPeso.Source; Canvas.SetLeft(SelImaPaquete, d.X); Canvas.SetTop(SelImaPaquete, d.Y); currPaquete = d; }
protected override void OnNavigatedTo(NavigationEventArgs e) { VMWrapper mWrapper = e.Parameter as VMWrapper; mWrapper_ = mWrapper; mWrapper_.Time = time_; mWrapper_.Objectives = 0; mWrapper_.TotalObjectives = totalObjectivos; if (mWrapper != null) { //dronImagen.Source = mWrapper.Dron.Img.Source; paqueteSel.Source = mWrapper.Paquete.Img.Source; } VMDron VMItem = new VMDron(mWrapper.Dron); // VMPaquete VMDest = new VMPaquete(mWrapper.Paquete); ListaDrones.Add(VMItem); paqueteSelec = mWrapper.Paquete; canvas.Children.Add(VMItem.CCImg); //canvas.Children.Add(VMDest.CCImg); canvas.Children.Last().SetValue(Canvas.LeftProperty, VMItem.X); canvas.Children.Last().SetValue(Canvas.TopProperty, VMItem.Y); // canvas.Children.Last().SetValue(Canvas.LeftProperty, VMDest.X -100); // canvas.Children.Last().SetValue(Canvas.TopProperty, VMDest.Y -100); if (ListaDestinos != null) { foreach (Paquete paquete in ModelPaquete.GetAllPaquetes()) { VMPaquete VMDestino = new VMPaquete(paquete); ListaDestinos.Add(VMDestino); VMDestino.CCImg.Visibility = Windows.UI.Xaml.Visibility.Visible; canvas.Children.Add(VMDestino.CCImg); canvas.Children.Last().SetValue(Canvas.LeftProperty, VMDestino.X - 25); canvas.Children.Last().SetValue(Canvas.TopProperty, VMDestino.Y - 25); } } dispatcherTimer.Start(); /* * ListaDrones.Add(mWrapper.Dron); * canvas.Children.Add(mWrapper.Dron.CCImg); * canvas.Children.Last().SetValue(Canvas.LeftProperty, mWrapper.Dron.X - 25); * canvas.Children.Last().SetValue(Canvas.TopProperty, mWrapper.Dron.Y - 25); */ base.OnNavigatedFrom(e); }
protected override void OnNavigatedTo(NavigationEventArgs e) { //// Carga la lista de ModelView a partir de la lista de Modelo if (ListaPaquetes != null) { foreach (Paquete dron in ModelPaquete.GetAllPaquetes()) { VMPaquete VMitem = new VMPaquete(dron); ListaPaquetes.Add(VMitem); } } if (ListaDrones != null) { foreach (Dron dron in Model.GetAllDrones()) { VMDron VMitem = new VMDron(dron); ListaDrones.Add(VMitem); } } currDron = ListaDrones[0]; currPaquete = ListaPaquetes[0]; base.OnNavigatedTo(e); }