Beispiel #1
0
        // respond to click event
        protected override async void OnClick()
        {
            string xml = "";
            var    toc = MappingModule.ActiveTOC;

            if (toc != null)
            {
                // get toc highlighted layers
                var selLayers = toc.SelectedLayers;
                // retrieve the first one
                Layer layer = selLayers.FirstOrDefault();
                if (layer != null)
                {
                    // find the CIM and serialize it
                    CIMBaseLayer cim = await layer.QueryLayerDefinitionAsync();

                    xml = XmlUtil.SerializeCartoXObject(cim);
                }
            }

            if (string.IsNullOrEmpty(xml))
            {
                return;
            }

            // show it
            CIMViewerViewModel vm = new CIMViewerViewModel();

            vm.Xml = xml;

            ArcGIS.Desktop.Internal.Framework.DialogManager.ShowDialog(vm, null);
        }
        // respond to click event
        protected override async void OnClick()
        {
            string xml = "";
            var toc = MappingModule.ActiveTOC;
            if (toc != null)
            {
                // get toc highlighted layers
                var selLayers = toc.SelectedLayers;
                // retrieve the first one
                Layer layer = selLayers.FirstOrDefault();
                if (layer != null)
                {
                    // find the CIM and serialize it
                    CIMBaseLayer cim = await layer.QueryLayerDefinitionAsync();
                    xml = XmlUtil.SerializeCartoXObject(cim);
                }
            }

            if (string.IsNullOrEmpty(xml))
                return;

            // show it
            CIMViewerViewModel vm = new CIMViewerViewModel();
            vm.Xml = xml;

            ArcGIS.Desktop.Internal.Framework.DialogManager.ShowDialog(vm, null);
        }