Frequently Asked Questions - Blazor UI (FAQ)
- 8 minutes to read
Differences between XAF Blazor UI and XAF WinForms/WebForms UI
Q: Why do XAF Blazor UI apps implement different behavior/options?
A: ASP.NET Core Blazor, .NET WinForms, and ASP.NET Web Forms are three distinct Microsoft technologies/frameworks, with release dates about 20 years apart. Platform architecture is naturally very different: the view on application development and security has evolved, as did usage scenarios and developer requirements. And you may not be sure, given the platform choice, if you should go with a “proven and tested” versus “most modern” technology.
Even though Blazor is the youngest of the three, we believe it is ready for most line-of-business applications. We recommend that you use XAF Blazor UI for new applications. You can also transfer existing apps.
XAF Blazor UI offers you numerous unique benefits over Web Forms such as:
- .NET vs .NET Framework (review a comparison by Microsoft).
- Cross-platform support (run on multiple platforms - Windows, Linux, and macOS - and use desktop and mobile web browsers).
- More flexible deployment (use a cloud provider such as Azure, Docker containers hosted in Linux or Windows infrastructure, or even Kubernetes for increased performance/scalability).
- Dependency Injection and microservice architecture support (add, replace, or extend XAF services/modules).
- Backend Web API Service (consume XAF data and business logic from any external application or service).
- Entity Framework Core (access data using the ORM developed by Microsoft and used by millions of developers).
- Multi-Tenancy Module (implement multi-tenant or SaaS-ready applications with multiple databases).
- OAuth2 Authentication (use Microsoft Entra ID or Google providers).
- End-User/Runtime Layout Customization (create and manage detail form UI directly in the web browser).
If you migrate your applications, keep in mind that not all solutions applicable to WinForms or Web Forms are suitable for Blazor. Our approach towards Blazor development does not mean identical replication of behavior from our Web Forms or WinForms modules and features. You may need to adjust your applications if you transition to Blazor.
If you find reasons against transition, you can continue using ASP.NET Web Forms or WinForms UI. In such cases, please let us know why you chose not to migrate. Reach out to us via our Support Center and tell us about your use cases and requirements. Your feedback and insights are incredibly valuable in shaping our offerings to best meet your needs.
Reuse Existing .NET Framework Code
Q: I want to create a Blazor UI application based on an existing XAF .NET Framework application. How do I proceed?
A: You can re-use most ORM data models and platform-agnostic controllers in Blazor UI with minimal or no changes. The basic CRUD and data view XAF APIs are platform-agnostic, for example, IObjectSpace, ViewController, View, or Frame.
You can add existing platform-independent modules to an XAF Blazor UI project. Convert required modules to .NET 6+: .NET 6+ Support and Migration from .NET Framework. Once conversion is complete, refer to the following article for further instructions: (Add a Module in Code).
All platform-dependent code should be rewritten. Blazor applications have a different architecture and life cycle; the code that was common for ASP.NET Web Forms and Windows Forms may need to be changed for Blazor. Refer to the following article for more information: An introduction to Blazor for ASP.NET Web Forms developers.
Add a Custom XAF Module
Q: How do I add a new custom XAF module into an existing Blazor solution?
A: Use the Add DevExpress Item | New Project menu to add a new custom XAF module to an existing XAF .NET app.
Integrate Custom UI Components
Q: How do I use components that are not integrated in the Blazor UI by default?
A: Review the list of DevExpress Blazor and JavaScript (DevExtreme) UI components and the following XAF integration articles:
- Implement a List Editor Based on a Custom Component
- Access Grid Control Settings
- Implement a Property Editor Based on a Custom Component
- Access Detail View Property Editor Settings | Customize a Built-in Property Editor
- Add DevExtreme Widgets to an Application
Integrate a custom DevExtreme component and bind it to a data source
Show a fully custom non-XAF web form (with custom controls, JavaScript, Razor components, etc.)
- How to implement a QR / barcode scanner using a camera of a mobile device
- Create a Custom Blazor Application Template
- Implement a custom Action type
- Control Property Visibility in Filter Editors
- How to: Show a Custom Data-Bound Control in an XAF View (Blazor) - External Data
- How to: Show a Custom Data-Bound Control in an XAF View (Blazor) - Current Object Data
- Access Form Layout Control in XAF DetailView and DashboardView
You can review how we implement List and Property Editors. This may help you integrate custom components. See the files in the following folder: %PROGRAMFILES%\DevExpress 24.2\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Blazor\Editors\.
Access ASP.NET Core DI Services via IServiceProvider
Q: How do I access services from a built-in ASP.NET Core service container (IServiceProvider)?
A: To access BlazorApplication.IServiceProvider
, use the following code: XafApplication.ServiceProvider. For more information, see the following topic: Dependency Injection (DI).
You may find the following examples helpful:
- Download files or navigate to a URL using custom XAF Actions: a code example that uses the standard ASP.NET Core NavigationManager service.
- Read a connection string or other values from appsettings.json in code using a ViewController: a code example that uses the standard ASP.NET Core IConfiguration service.
- Access HttpContext to get cookies, user agent, client IP address, query string and other request information: a ticket with more information on the standard ASP.NET Core IHttpContextAccessor service.
- Access JSRuntime to call JavaScript from .NET code: a code example that uses the standard ASP.NET Core IJSRuntime service.
- Access IHttpClientFactory to make HTTP requests.
Using GPS and Camera on Mobile Devices
Q: Can I upload photos from a mobile device camera in XAF Blazor apps?
A: Yes. Evolved web development standards and modern browsers made it possible to accomplish many hardware-related tasks (GPS, camera, etc.) in such applications. See also: How to implement a QR / barcode scanner using a camera of a mobile device.
Deployment
Q: Can I deploy XAF Blazor apps to Cloud platforms (Azure, AWS, etc.), Linux (with Nginx or Apache), Windows (with IIS), Docker, and Kubernetes?
A: Yes, absolutely. For more information, refer to the following articles:
- Deployment Recommendations for XAF Blazor UI Applications
- Deploy an ASP.NET Core Blazor Server Application to IIS
- Deploy an ASP.NET Core Blazor Server Application to Azure App Service
- Deploy an ASP.NET Core Blazor Server Application to Linux with Nginx
High Load and Scaling
Q: Is Blazor UI appropriate for applications with thousands of concurrent users?
A: We cannot recommend XAF’s Blazor UI for high-load applications that should serve hundreds or thousands of concurrent web clients on a single web server. Refer to the following article for details: Deployment Recommendations for XAF Blazor UI Applications.
Offline Mode Support
Q: Does XAF Blazor UI support offline mode?
A: No. The current Blazor Server platform requires a permanent connection to a server.
Supported Identity Providers
Q: Does XAF’s Blazor UI support OAuth2 (Azure AD, Microsoft 365, Google Firebase, etc.) or JWT authentication (Identity Server, Auth0, etc.)?
A: Yes, XAF supports these identity providers with the help of built-in ASP.NET Core capabilities and XAF’s security system extensibility. You may find the following examples helpful:
- How to: Use Active Directory and OAuth2 Authentication Providers in Blazor Applications
- Identity Server usage example and video.
Supported Browsers
Q: What are the supported desktop and mobile web browsers?
A: You can find the supported browser list in the following Microsoft article: https://learn.microsoft.com/en-us/aspnet/core/blazor/supported-platforms (Microsoft Internet Explorer 11 and older versions are not supported).
We test the XAF Blazor UI in the following environments:
- The latest desktop Google Chrome and Mozilla FireFox versions (automated tests and screenshot-based tests with EasyTest and Selenium).
- The latest versions of Google Chrome on Android, Safari (including iOS), and Microsoft Edge (manual testing).
Keep Connection Alive
The XAF Blazor UI is a regular ASP.NET Core Blazor Server application that uses SignalR
to keep a connection to the server alive. Use the following solution to manage this behavior: Timeout and keepalive settings.
Blazor WebAssembly
Q: Does XAF Blazor UI support WebAssembly?
A: XAF Blazor UI generates an application based on the Blazor Server hosting model. You can also build a custom Blazor WebAssembly app and reuse parts of your XAF project: data model, select modules (such as Security, Reporting, File Attachments), and custom logic. Use our backend Web API Service for this purpose. Review the corresponding GitHub Example & Tutorial for more information.