示例#1
0
        public void ApplyNewLayout(string newLayoutRelativePath)
        {
            DisposeView();

            layoutResourceDictionaries = null;
            LayoutFilePath             = getUrl(newLayoutRelativePath);
            View.Instance.SaveExtensionsConfigData();
            if (ToolPanels != null)
            {
                // save the XML for the toolPanels
                toolsXmlFileContents = ToolPanels.GetToolPanelsXml();
            }
            ToolPanels.Current.Clear();
            behaviorsXmlFileContents = GetBehaviorsXml().ToString(SaveOptions.OmitDuplicateNamespaces);
            controlsXmlFileContents  = View.GetConfigurationOfControls();

            disposeExtensibilityObjects();
            if (ViewerApplication != null)
            {
                ViewerApplication.LayoutFilePath = newLayoutRelativePath;
            }
            downloadLayoutFile();

            // Reset the Identify Popup control and content
            PopupHelper.Reset();
        }
示例#2
0
 internal void BackToOriginalContent(OnClickPopupInfo popupInfo)
 {
     if (_OriginalPopupContent != null)
     {
         InfoWindow win = popupInfo.Container as InfoWindow;
         if (win != null)
         {
             Dispatcher.BeginInvoke(() =>
             {
                 win.Content = _OriginalPopupContent;
                 PopupHelper.SetDisplayMode(PopupHelper.DisplayMode.ReadOnly);
             });
         }
     }
 }
示例#3
0
        public override void Execute(object parameter)
        {
            if (!CanExecute(parameter))
            {
                return;
            }

            var popupInfo = PopupInfo as OnClickPopupInfo;

            if (popupInfo == null)
            {
                return;
            }

            InfoWindow win = popupInfo.Container as InfoWindow;

            if (win != null)
            {
                Dispatcher.BeginInvoke(() =>
                {
                    try
                    {
                        FeatureLayer featureLayer = popupInfo.PopupItem.Layer as FeatureLayer;
                        if (featureLayer == null)
                        {
                            return;
                        }

                        FeatureDataForm form = new FeatureDataForm
                        {
                            Width  = win.ActualWidth,
                            Height = win.ActualHeight,
                            Style  = PopupFeatureDataFormStyleHelper.Instance.GetStyle("PopupFeatureDataFormStyle"),
                            CommitButtonContent = Resources.Strings.Apply,
                            GraphicSource       = popupInfo.PopupItem.Graphic,
                            FeatureLayer        = featureLayer,
                            DataContext         = popupInfo,
                        };

                        form.Loaded += (s, e) =>
                        {
                            // enable switching back to the original popup content when the 'Back' button is clicked
                            List <Button> buttons = ControlTreeHelper.FindChildrenOfType <Button>(form, int.MaxValue);
                            if (buttons != null && buttons.Count > 0)
                            {
                                Button backButton = buttons.Where(b => b.Name == "BackButton").FirstOrDefault();
                                if (backButton != null)
                                {
                                    backButton.Content = Resources.Strings.EditValuesCommandEditorBackButtonContent;
                                    backButton.Click  += (ss, ee) => BackToOriginalContent(popupInfo);
                                }
                                Button closeButton = buttons.Where(b => b.Name == "CloseButton").FirstOrDefault();
                                if (closeButton != null)
                                {
                                    closeButton.Click += (ss, ee) => BackToOriginalContent(popupInfo);
                                }
                            }
                            PopupHelper.SetDisplayMode(PopupHelper.DisplayMode.EditValues);
                        };
                        win.Content = null;
                        win.Content = form;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex);
                    }
                });
            }
        }