Exemplo n.º 1
0
        /// <summary>
        /// Handler for event - PlanG flight plan open requested
        /// </summary>
        private void OnReqPlanGOpen(FlightPlanReqPlanGOpenEventPayload payload)
        {
            if (payload == null || string.IsNullOrWhiteSpace(payload.Path))
                return;

            var task = Task.Run(() => ParsePlanGFlightPlan(payload.Path))
                .ContinueWith(FlightPlanParsed, TaskScheduler.FromCurrentSynchronizationContext());
        }
Exemplo n.º 2
0
        public FlightPlanToolBarViewModel(IInteractionService interactionService, IEventAggregator evtAggregator)
        {
            InitializeCommands();
            _interactionService = interactionService;
            _evtAggregator = evtAggregator;

            #if DEBUG
            var evtPayload = new FlightPlanReqPlanGOpenEventPayload() { Path = @"DebugData\PANCPAFA.plg" };
            _evtAggregator.GetEvent<FlightPlanReqPlanGOpenEvent>().Publish(evtPayload);
            #endif
        }
Exemplo n.º 3
0
        private void OpenPlanG()
        {
            var task = _interactionService.ShowOpenFileDialogAsync();
            task.ContinueWith(t =>
            {
                var path = t.Result;
                if (string.IsNullOrWhiteSpace(path))
                    return;

                var evtPayload = new FlightPlanReqPlanGOpenEventPayload() { Path = path };
                _evtAggregator.GetEvent<FlightPlanReqPlanGOpenEvent>().Publish(evtPayload);
            },
            TaskScheduler.FromCurrentSynchronizationContext());
        }