关于在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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值