예제 #1
0
        public FlightPageViewModel()
        {
            if (DesignMode.DesignModeEnabled)
            {
                var random = new Random();

                // Design data
                var flight = new FlightData { Name = "Vol 1234", Date = "06/11/2013", StartTime = TimeSpan.Parse("11:50"), EndTime = TimeSpan.Parse("11:55"), Duration = "5 min", AltitudeMax = "10m", AltitudeMin = "1m" };
                for (int j = 0; j < 10; j++)
                {
                    flight.Pictures.Add(new FlightPictureData {Index  = j, Name = "Image " + j, Source = "/Assets/Samples/Image" + random.Next(1, 3) + ".jpg" });
                    flight.Videos.Add(new FlightVideoData { Name = "Video " + j, Preview = "/Assets/Samples/Video" + random.Next(1, 3) + ".png" });
                }

                CurrentFlight = flight;
            }
        }
예제 #2
0
        public void OnNavigatedTo()
        {
            if (DesignMode.DesignModeEnabled)
            {
                return;
            }

            Flights = new ObservableCollection<FlightData>();

            var random = new Random();
            // Design data
            for (int i = 0; i < 10; i++)
            {
                var flight = new FlightData { Name = DateTime.Now.AddDays(-i).ToString("dd/MM/yyyy"), Date = DateTime.Now.AddDays(-i).ToString("dd/MM/yyyy"), StartTime = TimeSpan.Parse("11:50"), EndTime = TimeSpan.Parse("11:55"), Duration = "5 min", AltitudeMax = "10m", AltitudeMin = "1m" };

                for (int j = 0; j < 10; j++)
                {
                    flight.Pictures.Add(new FlightPictureData { Index = j, Name = "Image " + j, Source = "/Assets/Samples/Image" + random.Next(1, 3) + ".png" });
                    flight.Videos.Add(new FlightVideoData { Name = "Video " + j, Preview = "/Assets/Samples/Video" + random.Next(1, 3) + ".png" });
                }

                Flights.Add(flight);
            }
        }
예제 #3
0
 public void OnNavigatedTo(FlightData flightData)
 {
     CurrentFlight = flightData;
 }