/// <summary> /// Open FeatureDataForm to Edit Attributes /// </summary> private void OpenFeatureDataEditor(FeatureLayer layer, Graphic graphic) { if (featureEditor.ClearSelection.CanExecute(null)) { featureEditor.ClearSelection.Execute(null); } graphic.Select(); dataEditorForm.FeatureLayer = layer; dataEditorForm.GraphicSource = graphic; dataEditorWindow.Title = layer.LayerInfo.Name; if (layer.LayerInfo.HasAttachments) { attachmentEditor.GraphicSource = graphic; attachmentEditor.FeatureLayer = layer; attachmentEditor.Visibility = Visibility.Visible; } else { attachmentEditor.Visibility = Visibility.Collapsed; } FloatingPopup.Show(dataEditorWindow); //Show Attribute Editing Window at Feature Geometry's Centroid //FloatingPopup.Show(dataEditorWindow, MapControl.MapToScreen(graphic.Geometry.Extent.GetCenter())); }
private void LinkMenuButton_MenuItemClick(object sender, MenuItemClickEventArgs e) { string sUrl = (string)e.ItemTag; if (!string.IsNullOrEmpty(sUrl)) { if (sUrl.Equals("About")) { if (AboutWindow == null) { AboutWindow = new PopupWindow() { Title = "About", Background = this.Background, ShowArrow = false, IsResizable = false, IsFloatable = true }; StackPanel aboutContent = new StackPanel() { Orientation = Orientation.Vertical, Margin = new Thickness(12, 12, 12, 12) }; AboutWindow.Content = aboutContent; string[] contentLines = Regex.Split(AppConfig.AppHelpMenu.About.Text, @"\\n"); for (int i = 0; i < contentLines.Length; i++) { if (contentLines[i].Trim().StartsWith("http://", StringComparison.CurrentCultureIgnoreCase)) { HyperlinkButton linkBlock = new HyperlinkButton() { NavigateUri = new Uri(contentLines[i].Trim(), UriKind.Absolute), Content = contentLines[i].Trim(), Margin = new Thickness(2), FontSize = 12.5, Foreground = new SolidColorBrush(Colors.Blue), HorizontalAlignment = System.Windows.HorizontalAlignment.Center, TargetName = "_blank" }; aboutContent.Children.Add(linkBlock); } else { TextBlock textBlock = new TextBlock() { Text = contentLines[i].Trim(), Margin = new Thickness(2), FontSize = 12.5, HorizontalAlignment = System.Windows.HorizontalAlignment.Center }; aboutContent.Children.Add(textBlock); } } } FloatingPopup.Show(AboutWindow); } else { try { System.Windows.Browser.HtmlPopupWindowOptions winOptions = new System.Windows.Browser.HtmlPopupWindowOptions() { Resizeable = true, Width = 1000, Height = 800 }; System.Windows.Browser.HtmlWindow win = System.Windows.Browser.HtmlPage.PopupWindow(new Uri(sUrl, UriKind.Absolute), "_blank", winOptions); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }