In this lesson, you will learn how to associate a business class with a custom image. This image will represent the class in the navigation control, including detail and list form headers. For this purpose, the Contact class will be used. By default, it is associated with the image of its ancestor (the Person class). You will provide a custom image for the Contact class.

在本课中,您将学习如何将业务类与自定义图标相关联。此图像将表示导航控件中的类,包括详细信息和列表窗体标头。为此,将使用"联系人"类。默认情况下,它与其祖先(Person 类)的图像相关联。您将为联系人类提供自定义图标。

Note 注意

Before proceeding, take a moment to review the following lessons.

在继续之前,请花点时间复习以下课程。

  • Place an Action in a Different Location
  • Assign a Standard Image
  • In the Solution Explorer, navigate to the Images folder in MySolution.Module project. XAF loads images from this folder.

    For this tutorial, you can use custom image files or load them from the %PROGRAMFILES(x86)%\DevExpress 19.2\Components\Sources\DevExpress.Images\Images folder.

  • 将操作放置在其他位置
  • 分配标准映像
  • 在"解决方案资源管理器"中,导航到 MySolution.模块项目中的"映像"文件夹。XAF 会从此文件夹中加载图像。
  • 在本教程中,您可以使用自定义图像文件或从 %PROGRAMFILES(x86)%_DevExpress 19.2_组件_源DevExpress.Images_Images_Images_Images 文件夹加载它们。

To use an SVG image in a C# project, save it as as \MySolution.Module\Images\Employee.svg.

To use an SVG image in a Visual Basic project, save it as \MySolution.Module\Images\MySolution.Module.Images.Contact.svg and ensure "Images" is capitalized in the file name.

For ASP.NET applications, use additional files for an icon's active and disabled states. These items must have the same name as the first file you added and a state's suffix, for example, Employee_Active.svg and Employee_Disabled.svg.

要在 C# 项目中使用 SVG 映像,将其另存为 [MySolution.模块_映像]员工.svg。

要在可视化基本项目中使用 SVG 图像,请将其保存为 [MySolution.模块]图像_MySolution.模块.Images.contact.svg 并确保在文件名中大写"图像"。

对于ASP.NET应用程序,为图标的活动状态和禁用状态使用其他文件。这些项目必须与您添加的第一个文件具有相同的名称,并且具有状态的后缀,例如,Employee_Active.svg 和Employee_Disabled.svg。

Note 注意

Refer to the Add and Override Images article for more information on how to use SVG and PNG images in XAF applications.

有关如何在 XAF 应用程序中使用 SVG 和 PNG 映像的详细信息,请参阅添加和覆盖图像一文。

  • In Solution Explorer, select the module project and click the Show All Files () toolbar button. Select the images in the Images subfolder, right-click the selection, and choose Include In Project.

  • 在"解决方案资源管理器"中,选择模块项目并单击"显示所有文件(showall_btn)"工具栏按钮。选择"图像"子文件夹中的图像,右键单击所选内容,然后选择"包括在项目中"。

 

Visual Basic

视觉基础

  • Select the images and switch to the Properties window. Set the Build Action option to Embedded Resource.

  • 选择图像并切换到"属性"窗口。将"生成操作"选项设置为嵌入资源。

  • Invoke the Model Editor. Navigate to the BOModel | MySolution.Module.BusinessObjects | Contact node and set its ImageName property to "Employee".

  • 调用模型编辑器。导航到 BOModel |My解决方案.模块.业务对象 |联系节点并将其 ImageName 属性设置为"员工"。

    Note 注意
    • When the ImageName property is focused, the ellipsis button () is displayed to the right of the property value. You can click this button to invoke the Image Picker dialog and browse the available images.
    • You can use the ImageNameAttribute to specify an image in code.
    • 聚焦 ImageName 属性时,省略号按钮 (EllipsisButton) 将显示在属性值的右侧。可以单击此按钮以调用"图像选取器"对话框并浏览可用图像。
    • 可以使用 ImageName 属性在代码中指定图像。
  • Run the application. Notice that the Contact navigation item now has a custom image assigned.

  • 运行应用程序。请注意,联系人导航项现在已分配自定义图像。

  • WinForms Application

WinForms 应用程序

ASP.NET Application

ASP.NET应用程序

You can see the changes made in this lesson in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

.您可以在主演示中看到本课中所做的更改 |主演示模块项目。主演示应用程序安装在%PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

Assign a Custom Image 设置自定义图标的更多相关文章

  1. echart 图例设置自定义图标?

    option = { legend: { orient: 'horizontal', // 'vertical' x: 'right', // 'center' | 'left' | {number} ...

  2. 关于在Safari浏览器中将网页添加到主屏幕的相关设置(自定义图标,启动动画,自定义名称)

    在ios中我们可以使用Safari浏览自带的将网页添加到主屏幕上,让我们的web页面看起来像native那样 第一步: 第二步: 第三步: 到这里还没结束:我们还要进行相关设置才能使我们的应用更像原生 ...

  3. 百度地图api设置点的自定义图标不显示

    百度地图api设置点的设置代码为: var myIcon = new BMap.Icon(): 所以首先要找到这行代码,并在括号中加上图片信息: var myIcon = new BMap.Icon( ...

  4. Sencha Touch 2.2.1 Custom Icon 自定义图标

    ST2.2版本竟然又改变了sass中自定义图标的添加方式,在2.2以前采用的是这种base64的方式,详见:http://www.cnblogs.com/qidian10/archive/2012/1 ...

  5. [DevExpress]treeList1背景色设置与自定义图标

    为了和系统界面一致改成透明色: treeList1.BackColor = Color.Transparent; treeList1.Appearance.Empty.BackColor = Colo ...

  6. SharePoint REST API - 使用REST接口对列表设置自定义权限

    博客地址:http://blog.csdn.net/FoxDave SharePoint网站.列表和列表项都属于SecurableObject类型.默认情况下,一个安全对象继承父级的权限.对一个对 ...

  7. Windows 8.1——将网站固定到开始菜单,自定义图标、颜色和Windows推送通知

    记得在IE 9和Windows 7刚出来那会儿我写过一篇文章来介绍如何自定义网站将其固定到Windows的任务栏上,同时自定义图标及任务内容.那个功能在IE 9中被称之为JumpList.http:/ ...

  8. Delphi 7使用自定义图标关联文件类型

    Delphi 7使用自定义图标关联文件类型 5.2 Delphi编程(40)  版权声明:本文为博主原创文章,未经博主允许不得转载. 在开发过程中,我们经常需要属于自己的文件类型,自定义的后缀名不仅可 ...

  9. 将网站固定到开始菜单,自定义图标、颜色和Windows推送通知

    Windows 8.1——将网站固定到开始菜单,自定义图标.颜色和Windows推送通知 记得在IE 9和Windows 7刚出来那会儿我写过一篇文章来介绍如何自定义网站将其固定到Windows的任务 ...

随机推荐

  1. Git详细教程之创建本地仓库和连接Github仓库

    首先要知道不只有代码,任何类型的文件都可以进行版本控制,版本控制很重要的一个特性就是你可以随时修改,比如git会记录你的任何操作,如果你想要回退到任何一个历史操作,你可以通过git轻松达到. 本地仓库 ...

  2. 剑指offer笔记面试题2----实现Singleton模式

    题目:设计一个类,我们只能生成该类的一个实例. 解法一:单线程解法 //缺点:多线程情况下,每个线程可能创建出不同的的Singleton实例 #include <iostream> usi ...

  3. Java工作流引擎表单引擎之JS表单字段输入脚本验证

    关键字: 表单设计器, 字段验证. workflow,ccform, ccBPM. 工作流快速开发平台  工作流流设计  业务流程管理   asp.net 开源工作流bpm工作流系统  java工作流 ...

  4. 原生js的2048的制作过程

    1.首先我们来看一下效果图 开始: 结束: 接下来我们来实现代码部分: HTML部分: 2048大家应该都玩过,首先我们要准备16个盒子让它4*4排列,这里的css我就不说了,这应该使我们都会的,在这 ...

  5. JCC 指令

    JCC跳转指令 JCC指条件跳转指令,CC就是指条件码. JCC指令 中文含义 英文原意 检查符号位 典型C应用 JZ/JE 若为0则跳转:若相等则跳转 jump if zero;jump if eq ...

  6. 前端小白webpack学习(四)

    .less文件与.scss文件使用与.css文件相仿 less-loader使用需要借助less插件,终端输入npm i less less-loader -D安装; sass-loader使用需要借 ...

  7. 物联网架构_对AWS的Greengrass的认识与理解

    物联网架构_对AWS的Greengrass的认识与理解 一,前言: 这段时间有许多的收获,分析,还有总结,其中包括新系统的设计与开发,以及其中新技术的踩坑等等等. 但是最近真的很忙,项目的推进,面试工 ...

  8. 基于canvas二次贝塞尔曲线绘制鲜花

    canvas中二次贝塞尔曲线参数说明: cp1x:控制点1横坐标 cp1y:控制点1纵坐标 x: 结束点1横坐标 y:结束点1纵坐标 cp2x:控制点2横坐标 cp2y:控制点2纵坐标 z:结束点2横 ...

  9. java 超详细面经整理(持续更新)2019.12.19

    目录 Java SE 请你解释HashMap中为什么重写equals还要重写hashcode? 请你介绍一下map的分类和常见的情况 请你讲讲Java里面的final关键字是怎么用的? 请你谈谈关于S ...

  10. Spring 框架下的 JDBC

    Spring JDBC Spring 对JDBC技术规范做了进一步封装,它又叫Spring JDBCTemplate(jdbc模板技术) 纯JDBC:代码清晰的.效率最高.代码是最烦的.    Spr ...