Application Icon, Logo & About Info(应用程序图标、徽标和关于信息)
Application Logo and Info(应用程序徽标和信息)
XAF-powered WinForms applications display an application logo and supplementary application information within an About window. XAF-powered ASP.NET Web Forms and ASP.NET Core Blazor applications display this information at the top-left and bottom-left corners of the main page.
XAF驱动的WinForms应用程序在关于窗口中显示应用程序徽标和补充应用程序信息。XAF驱动的ASP.NETWeb窗体和ASP.NETCore Blazor应用程序在主页的左上角和左下角显示此信息。
You can specify info texts in the Model Editor‘s Application root node. This node also allows you to change a logo image in WinForms applications. To customize a logo image for an ASP.NET Core Blazor application, specify the image name in the header-logo CSS class. For more information, refer to the following help topic: Change an Application Logo and Info.
您可以在模型编辑器的应用程序根节点中指定信息文本。此节点还允许您更改WinForms应用程序中的徽标图像。要为ASP.NETCore Blazor应用程序自定义徽标图像,请在头徽标CSS类中指定图像名称。有关详细信息,请参阅以下帮助主题:更改应用程序徽标和信息。
Application Icon(应用程序图标)
WinForms Applications(WinForms应用程序)
XAF specifies a WinForms application icon in the Icon property within the Application page of the Project Designer. This approach is common for .NET Windows Forms applications (see How to: Specify an Application Icon). The icon is displayed in the compiled application at the top-left corner of the form, in the Windows Explorer, and the Windows taskbar. The default icon (ExpressApp.ico) is in the WinForms application project folder.
XAF在项目设计器的应用程序页面的图标属性中指定一个WinForms应用程序图标。这种方法对于. NET Windows窗体应用程序很常见(请参阅如何:指定应用程序图标)。该图标显示在窗体左上角的已编译应用程序、Windows资源管理器和Windows任务栏中。默认图标(ExpressApp.ico)位于WinForms应用程序项目文件夹中。
ASP.NET Core Blazor Applications(ASP.NET核心Blazor应用)
To change the application icon that is displayed in browser tabs, replace the MySolution.Blazor.Server\wwwroot\favicon.ico file with a custom image. This approach applies to all ASP.NET Core applications.
若要更改浏览器选项卡中显示的应用程序图标,请将MySolutions. Blazor.Server\wwwroot\avicon.ico文件替换为自定义图像。此方法适用于所有ASP.NET核心应用程序。
Splash Screen(启动画面)
WinForms Applications(WinForms应用程序)
XAF-powered WinForms applications display the following Splash Screen on startup:
XAF驱动的WinForms应用程序在启动时显示以下启动屏幕:
Applications with the Security System also display the Overlay Form over the Logon Form.
带有安全系统的应用程序还会在登录表单上显示覆盖表单。
You can customize the startup behavior as described in the following help topics:
您可以按照以下帮助主题中的说明自定义启动行为:
- Splash Forms
- GetStartupActions()
ASP.NET Core Blazor Applications(ASP.NET核心Blazor应用)
XAF-powered ASP.NET Core Blazor applications display the following Splash Screen on startup:
XAF驱动的ASP.NETCore Blazor应用程序在启动时显示以下启动屏幕:
You can customize the default Splash Screen’s caption and image in the MySolution.Blazor.Server\Pages_Host.cshtml file. If you want to use a custom image, add it to the MySolution.Blazor.Server\wwwroot\images folder.
您可以在MySolutions. Blazor.Server\Pages_Host.cshtml文件中自定义默认启动画面的标题和图像。如果要使用自定义图像,请将其添加到MySolutions.Blazor.Server\wwwroot\图像文件夹中。
CSHTML
<!-- ... -->
<html lang="en">
<body>
<!-- ... -->
<component type="typeof(SplashScreen)"
render-mode="Static"
param-Caption='"My Blazor application"'
param-ImagePath='"images/CustomSplashScreenImage.svg"' />
<!-- ... -->
</body>
</html>
The following image shows the customized Splash Screen:
下图显示了自定义的启动屏幕:
If you want to display a custom Splash Screen instead of the default screen, follow the steps below:
如果要显示自定义启动画面而不是默认画面,请按照以下步骤操作:
1.Add a new Razor component to the ASP.NET Core Blazor application project. You can customize the built-in SplashScreenComponent or create your own. Note that the built-in Splash Screen uses the parameters specified in the _Host.cshtml file. The following code snippet shows how to customize SplashScreenComponent and access the param-ImagePath parameter:
向ASP.NETCore Blazor应用程序项目中添加新的Razor组件。您可以自定义内置SplashScreenComponent或创建自己的。请注意,内置Splash Screen使用_Host. cshtml文件中指定的参数。以下代码片段显示了如何自定义SplashScreenComponent和访问参数-ImagePath参数:
Razor
@using DevExpress.ExpressApp.Blazor.Components
<SplashScreenComponent>
<LoadingIndicator>
<img class="rounded bg-primary text-white p-3" src="@ImagePath" />
</LoadingIndicator>
</SplashScreenComponent>
@code {
[CascadingParameter(Name = "ImagePath")]
protected string ImagePath { get; set; }
}
2.In the MySolution.Blazor.Server\Pages_Host.cshtml file, set the Splash Screen’s param-ContentType parameter to the type of the newly created component:
在MySolutions. Blazor.Server\Pages_Host.cshtml文件中,将Splash Screen的参数-ContentType参数设置为新创建组件的类型:
CSHTML
<!-- ... -->
<html lang="en">
<body>
<!-- ... -->
<component type="typeof(SplashScreen)"
render-mode="Static"
param-Caption='"My ASP.NET Core Blazor application"'
param-ImagePath='"images/CustomSplashScreenImage.svg"'
param-ContentType="typeof(MySolution.Blazor.Server.Component)" />
<!-- ... -->
</body>
</html>
The example below customizes Splash Screen properties dynamically in code:
下面的示例在代码中动态自定义Splash Screen属性:
C#
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Blazor.Components;
using DevExpress.ExpressApp.Blazor.Services;
using Microsoft.AspNetCore.Components;
//..
public class CustomSplashScreen : SplashScreen {
[Inject] private IXafApplicationProvider XafApplicationProvider { get; set; }
private string caption;
protected override void OnInitialized() {
base.OnInitialized();
XafApplication Application = XafApplicationProvider.GetApplication();
caption = Application.Model.Company;
}
protected override void OnParametersSet() {
base.OnParametersSet();
Caption = caption;
}
}
After that, place this descendant in the MySolution.Blazor.Server\Pages_Host.cshtml file:
之后,将此后代放在MySolutions. Blazor.Server\Pages_Host.cshtml文件中:
cshtml
<!-- ... -->
<html lang="en">
<body>
<!-- ... -->
<component type="typeof(CustomSplashScreen)"
render-mode="Static"
param-Caption='"My ASP.NET Core Blazor application"'
param-ImagePath='"images/CustomSplashScreenImage.svg"'
/>
<!-- ... -->
</body>
</html>
You can also show the loading panel/indicator in XAF Blazor applications. For more information on possible approaches, refer to the following topic: Loading Panels / Splash Forms (ASP.NET Core Blazor).
您还可以在XAF Blazor应用程序中显示加载面板/指示器。有关可能方法的更多信息,请参阅以下主题:加载面板/飞溅表单(ASP.NETCore Blazor)。