Add and Replace Icons(添加和替换图标)
An application is more attractive if UI elements are associated with images. In XAF applications, images display or accompany default Actions, navigation control items, Detail View captions, etc. You can replace the built-in images with custom ones, and set images for custom features implemented in separate modules.
如果UI元素与图像相关联,则应用程序更具吸引力。在XAF应用程序中,图像显示或附带默认操作、导航控件项、详细视图标题等。您可以用自定义图像替换内置图像,并为在单独模块中实现的自定义功能设置图像。
This topic explains how to add and replace icons in XAF applications.
本主题介绍如何在XAF应用程序中添加和替换图标。
Images Concept Overview(图像概念概述)
In XAF, there are three types of image sources.
在XAF中,有三种类型的图像源。
-
File Image Source(文件图像源)
For this source, a folder with images is specified. For each image, the Copy to Output Directory option must be set to Copy always, so the images will always be copied to the output directory.
为此源指定了一个包含图像的文件夹。对于每个图像,复制到输出目录选项必须设置为始终复制,因此图像将始终复制到输出目录。 -
Assembly Resource Image Source(装配资源镜像源)
This source stores the name of the assembly and the folder containing the images. For each image, the Build Action option must be set to Embedded Resource.
此源存储程序集的名称和包含图像的文件夹。对于每个图像,构建操作选项必须设置为嵌入式资源。 -
DevExpress.Images Assembly Resource Image Source(DevExpress. Images组装资源镜像源)
This default source provides access to all images from the DevExpress.Images assembly.
此默认源提供对来自DevExpress. Images程序集的所有图像的访问。
An application can have several image sources distributed between solution projects. To examine the image sources that will be available when running your application, invoke the Model Editor for an application project (Windows Forms or ASP.NET Web Forms). Locate the ImageSources node. Its child nodes represent image sources. The following image demonstrates the auto-generated image sources from which images are loaded to the Windows Forms version of the Main Demo.
应用程序可以在解决方案项目之间分布多个图像源。要检查运行应用程序时可用的图像源,请为应用程序项目(Windows窗体或ASP.NETWeb窗体)调用模型编辑器。找到ImageSsource节点。它的子节点代表图像源。下图演示了自动生成的图像源,从这些图像源中加载图像到主演示的Windows窗体版本。

The following image sources are available:
以下图像源可用:
- Images: File Image Source(文件图像源)
This image source is generated for the Images folder located in the application project. By default, this folder is added to the Web application project. It contains images specific to the ASP.NET Web Forms application. In a Windows Forms application project, there is no Images folder by default. However, you can add it. The images added to this folder will be found by the system when required, since an image source is created for this folder automatically.
此图像源是为应用程序项目中的图像文件夹生成的。默认情况下,此文件夹将添加到Web应用程序项目中。它包含特定于ASP.NETWeb窗体应用程序的图像。在Windows窗体应用程序项目中,默认情况下没有图像文件夹。但是,您可以添加它。添加到此文件夹的图像将在需要时由系统找到,因为会自动为此文件夹创建图像源。
- DevExpress.ExpressApp.<AssemblyName>: Assembly Resource Image Source(装配资源镜像源)
This image source is automatically generated for the Images folder located in the referen

最低0.47元/天 解锁文章
385

被折叠的 条评论
为什么被折叠?



