Пример #1
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);
        }
Пример #2
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);
 }