private EngineMonitorNavigationParameter GenerateParameter(bool t6lSelected)
        {
            EngineMonitorNavigationParameter parameter = new EngineMonitorNavigationParameter()
            {
                IsT6LSelected = t6lSelected
            };

            var flights = this.GetSelectedFlight();
            var result = from one in flights
                         select one.Flight.FlightID;

            parameter.SelectedFlights = result.ToArray();

            return parameter;
        }
        private EngineMonitorNavigationParameter GetNavigatedParameter(object parameter)
        {
            if (parameter != null && parameter is EngineMonitorNavigationParameter)
            {
                return parameter as EngineMonitorNavigationParameter;
            }

            EngineMonitorNavigationParameter param = new EngineMonitorNavigationParameter() { IsT6LSelected = true };

            param.SelectedFlights = new string[] { AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentFlight.FlightID };

            return param;
        }
        private void SetFlights(EngineMonitorNavigationParameter parameter)
        {
            var flights = AircraftDataAnalysisWinRT.Services.ServerHelper.GetAllFlights(
                AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentAircraftModel,
                AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentFlight.Aircraft);

            foreach (var flight in flights)
            {
                this.m_model.FlightViewModel.Add(new FlightSelectItem(flight)
                {
                    IsSelected =
                    parameter.SelectedFlights.Contains(flight.FlightID)
                    //(flight.FlightID == AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentFlight.FlightID)
                });
            }

            foreach (var fl in this.m_model.FlightViewModel)
            {
                fl.PropertyChanged += fl_PropertyChanged;
            }
        }
        private void SetFlights(EngineMonitorNavigationParameter parameter)
        {
            var flights = AircraftDataAnalysisWinRT.Services.ServerHelper.GetAllFlights(
                AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentAircraftModel,
                AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentFlight.Aircraft);

            var flightSelectItems = from f in flights
                                    select new FlightSelectItem(f, this.m_model.FlightViewModel)
                                    {
                                        IsSelected =
                                        parameter.SelectedFlights.Contains(f.FlightID)
                                    };

            var sorted = from f2 in flightSelectItems
                         orderby f2.IsSelected descending
                         select f2;

            foreach (var flight in sorted) //flights)
            {
                this.m_model.FlightViewModel.Add(flight);

                //this.m_model.FlightViewModel.Add(new FlightSelectItem(flight)
                //{
                //    IsSelected =
                //    parameter.SelectedFlights.Contains(flight.FlightID)
                //    //(flight.FlightID == AircraftDataAnalysisWinRT.ApplicationContext.Instance.CurrentFlight.FlightID)
                //});
            }

            foreach (var fl in this.m_model.FlightViewModel)
            {
                fl.PropertyChanged += fl_PropertyChanged;
            }
        }