Exemplo n.º 1
0
 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];
 }
Exemplo n.º 2
0
        private void ImageListView_ItemClickDron(object sender, ItemClickEventArgs e)
        {
            VMDron d = e.ClickedItem as VMDron;

            //SelImaDron.Source = d.Img.Source;
            TextDronNombre.Text = d.Nombre;
            //TextInfoPaquete.Text = d.Explicacion;
            SelImaDron.Source     = d.Img.Source;
            ImgPesoDron.Source    = d.ImgPeso.Source;
            ImgVelDron.Source     = d.ImgVel.Source;
            ImgBateriaDron.Source = d.ImgBateria.Source;
            Canvas.SetLeft(SelImaDron, d.X);
            Canvas.SetTop(SelImaDron, d.Y);
            currDron = d;
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 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);
 }