public void Execute(Guid aircraftId, LogbookEntry logbookEntry) { ManualEntryParameters parameters = new ManualEntryParameters(aircraftId, logbookEntry); NavigationParameters navParams = new NavigationParameters { { NAV_PARAM_KEY, parameters } }; _regionManager.RequestNavigate(RegionNames.AppRegion, new Uri(nameof(ManualLogEntryView), UriKind.Relative), navParams); }
/// <summary>Called when the implementer has been navigated to.</summary> /// <param name="navigationContext">The navigation context.</param> public void OnNavigatedTo(NavigationContext navigationContext) { if (navigationContext.Parameters.ContainsKey(ShowManualEntryCommand.NAV_PARAM_KEY)) { _parameters = navigationContext.Parameters[ShowManualEntryCommand.NAV_PARAM_KEY] as ManualEntryParameters; if (_parameters?.LogbookEntry != null) { UpdateData(); } } }
/// <summary>Called when the implementer has been navigated to.</summary> /// <param name="navigationContext">The navigation context.</param> public void OnNavigatedTo(NavigationContext navigationContext) { if (navigationContext.Parameters.ContainsKey(ShowAutoEntryCommand.NAV_PARAM_KEY)) { _parameters = navigationContext.Parameters[ShowAutoEntryCommand.NAV_PARAM_KEY] as ManualEntryParameters; if (_parameters?.LogbookEntry != null) { _logEntry = _parameters.LogbookEntry; UpdateData(_parameters.LogbookEntry); } else { VistaOpenFileDialog ofd = new VistaOpenFileDialog(); bool?dlgResult = ofd.ShowDialog(); if (dlgResult.HasValue && dlgResult.Value) { _logEntry = _logbookService.GetEntryFromAcmiFile(new FileInfo(ofd.FileName)); _importFile = ofd.FileName; UpdateData(_logEntry); } } } }