关于在WPF应用程序中使用ArcGIS Engine控件的局限性

Posted LisenYang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于在WPF应用程序中使用ArcGIS Engine控件的局限性相关的知识,希望对你有一定的参考价值。

 ArcGIS Engine controls are Windows Forms controls. Before developing a Windows Presentation Foundation (WPF) application using ArcGIS Engine controls, consider the following limitations:

  1、 The ArcGIS License Control cannot be used when hosted in a WPF window. You must initialize the ArcGIS Engine license programmatically. For more information, see here:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using ESRI.ArcGIS.esriSystem;


namespace WpfApplication1

     /// <summary>
     /// App.xaml 的交互逻辑
     /// </summary>
     public partial  class App : Application
    
         protected  override  void OnStartup(StartupEventArgs e)
        
             base.OnStartup(e);
           
          
            InitializeEngineLicense();
        

         private  void InitializeEngineLicense()
        
            //注意下边这一句最后必须是EngineOrDesketop而不是Engine
            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
            //By default, the form uses the old-fashioned (pre-Windows XP) styles for common controls in a WPF application. To enable the newer styles
            System.Windows.Forms.Application.EnableVisualStyles();

            AoInitialize aoi =  new AoInitialize();

             //More license choices can be included here.
            esriLicenseProductCode productCode =
                esriLicenseProductCode.esriLicenseProductCodeEngine;
             if (aoi.IsProductCodeAvailable(productCode) ==
                esriLicenseStatus.esriLicenseAvailable)
            
                aoi.Initialize(productCode);
            
        
    

  2、The properties and events of ArcGIS Engine controls are not accessible through Extensible Application Markup Language (XAML). You must programmatically access them in the code behind file.

  3、ArcGIS Engine controls do not have dependency properties, and only one-way data binding is supported. ArcGIS Engine control properties can only be bound to a WPF element, and the opposite binding is not supported.

  4、ArcGIS Engine controls are rendered separately from WPF elements. As a result, all display related properties of a WPF host container, such as Transform, Clip, and Opacity, have no effect on the control.

  5、Windows Forms controls draw outside of the WPF drawing framework and are assigned the highest rendering order. Therefore, you should avoid the following:

  Overlapping WPF elements on top of the ArcGIS Engine controls

  Overlapping ArcGIS Engine controls on WPF elements

  These limitations apply to all Windows Forms controls that are hosted by a WPF application.

以上是关于关于在WPF应用程序中使用ArcGIS Engine控件的局限性的主要内容,如果未能解决你的问题,请参考以下文章

ArcGIS Runtime SDK for WPF 初始化

关于ArcGIS中ArcMap运行不了

关于arcgis的python脚本编程, shape文件出png图片问题

vs如何显示arcgis 二次开发工具控件

arcgis高手请教!!关于shp文件的用法。

ESRI ArcGIS:Map.ZoomOut()