private void EnableHereUseCase() { hereUseCase.Activate(false, wpfMap); if ((String.IsNullOrEmpty(Properties.Settings.Default.HereAppCode)) || Properties.Settings.Default.HereAppCode.Equals("Enter AppCode here") || (String.IsNullOrEmpty(Properties.Settings.Default.HereAppId)) || Properties.Settings.Default.HereAppId.Equals("Enter AppId here")) { return; } try { hereUseCase.Activate(true, wpfMap); } catch (Exception ex) { HereExpander.IsExpanded = true; MessageBox.Show(ex.Message); HereAppIdTextBox.Focus(); } }
/// <summary> Event handler for having loaded the main window. </summary> /// <param name="sender"> The sender of the Loaded event. </param> /// <param name="e"> The event parameters. </param> private void Window_Loaded(object sender, RoutedEventArgs e) { bool result = ConfigureWPFMap(wpfMap); if (!result) { var authenticationOK = UseCase.ManagedAuthentication.Set("api-eu-test", DefaultXServerInternetToken.Value); if (authenticationOK) { ConfigureWPFMap(wpfMap); } else { var msgBox = new MsgBox("Connection failed", UseCase.ManagedAuthentication.ErrorMessage); msgBox.ShowDialog(); } } // use case 'XServerConnection' XURLComboBox.DefaultText("Enter URL here", Properties.Settings.Default.XUrl); bool useDefaultToken = DefaultXServerInternetToken.Value.Equals(Properties.Settings.Default.XToken) || string.IsNullOrEmpty(Properties.Settings.Default.XToken); XTokenToggleButton.IsChecked = XTokenTextBox.IsReadOnly = useDefaultToken; XTokenTextBox.DefaultText("Azure: Enter xToken here", useDefaultToken ? DefaultXServerInternetToken.Value + " (Trial-Key)" : Properties.Settings.Default.XToken); // Use case 'HERE' HereAppIdTextBox.DefaultText("Enter AppId here", Properties.Settings.Default.HereAppId); HereAppCodeTextBox.DefaultText("Enter AppCode here", Properties.Settings.Default.HereAppCode); // Use case 'Clustering' clusteringUseCase.CheckBoxToDisable = ClusteringCheckBox; // Use case 'Additional WPF map' // For a dynamic extension of the column's count, a default column definition has to be inserted. MapGrid.ColumnDefinitions.Add(new ColumnDefinition { MinWidth = 50 }); // Use case 'Switch UI theme' UIThemeComboBox.SelectedIndex = 2; // This item corresponds to default theme // Use case 'Switch map style' ProfileComboBox.Text = "Silkysand"; ProfileOKButton_OnClick(null, null); // Use case 'xLocate' DeactivatedGeocodingRadiobutton.IsChecked = true; SingleFieldInput.Visibility = Visibility.Collapsed; MultiFieldInput.Visibility = Visibility.Collapsed; // Use case 'Tour planning' TourScenarioComboBox.SelectedIndex = 0; // First item corresponds to 'deactivated' TourPlanningStart.IsEnabled = false; #region doc:TourPlanningAsynchronousEvents tourPlanningUseCase.Initialized = () => { TourPlanningStart.IsEnabled = true; }; tourPlanningUseCase.Progress = (progressMessage, percent) => { TourPlanningStatus.Content = progressMessage; TourPlanningProgressBar.Value = percent; }; tourPlanningUseCase.Finished = () => { TourPlanningStart.Content = "Start planning"; TourScenarioComboBox.IsEnabled = true; TourPlanningStart.IsEnabled = true; }; #endregion //doc:TourPlanningAsynchronousEvents #region Intro initializing if (Properties.Settings.Default.IntroSkipped) { return; } var demoCenterIntro = new DemoCenterInstructions(IntroGrid); demoCenterIntro.StartIntro(); demoCenterIntro.HandlerCallback = (id, start) => { switch (id) { case "Connection": if (start) { Menu.IsExpanded = xServerExpander.IsExpanded = true; } ConnectionIntroEllpise.Visibility = (start) ? Visibility.Visible : Visibility.Hidden; break; case "xServerinternet": break; case "_SkippedIntro": Properties.Settings.Default.IntroSkipped = start; Properties.Settings.Default.Save(); break; case "ExploreUsecases": if (start) { Menu.IsExpanded = RoutingExpander.IsExpanded = true; } PossibilitiesIntroEllpise.Visibility = (start) ? Visibility.Visible : Visibility.Hidden; break; } }; #endregion }