年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

64 lines
2.3 KiB

using ESRI.ArcGIS.Carto;
using KGIS.Framework.Maps;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.MapView.Views;
using Kingo.PluginServiceInterface;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using UIShell.OSGi;
namespace Kingo.Plugin.SystemSetting.View.ViewSystemSetting
{
/// <summary>
/// 图层配置页面的交互逻辑
/// </summary>
public partial class ViewLayerCfgSetting : UserControl
{
public ViewLayerCfgSetting()
{
InitializeComponent();
this.Loaded += InitData;
}
private void InitData(object sender, RoutedEventArgs e)
{
try
{
IDataCatalogService _DataCatalog = BundleRuntime.Instance.GetFirstOrDefaultService<IDataCatalogService>();
LayerCfg rootLayer = _DataCatalog.CurrentLayers as LayerCfg;
List<LayerCfg> AllLayers = rootLayer.GetAllItem().FindAll(a => a.LayerType == EnumLayerType.FeatureLayer);
dgCtrl.ItemsSource = null;
dgCtrl.ItemsSource = AllLayers;
}
catch (Exception ex)
{
LogAPI.Debug("初始化图层配置页面失败:" + ex);
return;
}
}
private void BtnChangeLayerStyle_Click(object sender, RoutedEventArgs e)
{
try
{
FrameworkElement frameEle = e.Source as FrameworkElement;
DevExpress.Xpf.Grid.EditGridCellData gridCellData = frameEle.DataContext as DevExpress.Xpf.Grid.EditGridCellData;
LayerCfg selectCurrentLayer = gridCellData.RowData.Row as LayerCfg;
ILayer layer = MapsManager.Instance.MapService.GetFeatureLayerByLayerName(selectCurrentLayer.LayerName);
UCLayerStyleSet uCLayerStyleSet = new UCLayerStyleSet(layer);
//uCLayerStyleSet.Show();
uCLayerStyleSet.ShowInMainWindow(true);
}
catch (Exception ex)
{
MessageHelper.ShowError("打开图层样式窗体失败:" + ex.Message);
LogAPI.Debug("打开图层样式窗体失败:" + ex);
return;
}
}
}
}