Frequently Asked Questions - Blazor UI (FAQ)
- 6 minutes to read
Reuse Existing Code
Q: I want to create a Blazor UI app based on an existing XAF application. How do I proceed? A: You can re-use most of 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 Standard 2.0 or .NET 5+: .NET 5 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 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 5+ app.
Q: Can I create a VB.NET Blazor UI application?
A: You can attach your VB.NET modules converted to .NET Standard 2.0 to a C# Blazor application.
XAF does not ship a VB.NET project template for the Blazor UI. You cannot create a VB.NET Blazor application because Microsoft does not support this functionality: Support VB.NET in ASP.NET Core 3.0 and Blazor.
Integrate Custom Components
Q: How do I use components that are not integrated in the Blazor UI by default?
A: Review the list of DevExpress UI Components for Blazor and the following XAF integration articles:
- How to: Implement a Property Editor Based on a Custom Component (Blazor) | Color Property Editor | Multiple File Upload Property Editor
- How to: Customize a Built-in Property Editor (Blazor)
- Blazor - How to integrate a custom DevExtreme component and bind it to a data source | Create a Blazor Dashboard Application
- Office - How to edit rich text documents in XAF’s Blazor UI
- Blazor - Access Editor Settings
- Blazor - Access Grid Control Settings | Show total summaries
- Blazor - How to Implement a TreeList Editor
DevExpress MVPs Joche Ojeda and Jose Columbie published multiple XAF Blazor-related videos and samples on their YouTube channels:
- XAF Blazor Signature Property Editor Web & Mobile (Video)
- XAF Blazor Google Maps Property Editor (update) & Waze integration
- XAF Blazor Google Maps Editor Web & Mobile (Video)
- DevExpress Dashboards + XAF’s Blazor Server UI (Video)
- DevExpress Scheduler for Blazor Server Side (Video)
- Blazor - How to integrate the Pivot Grid into an XAF app
- Blazor - How to implement a Progress Bar in Grid List Editor cells
- Blazor - How to set editor mask settings (video)
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(x86)%\DevExpress 21.1\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Blazor\Editors\.
Q: What are the supported desktop and mobile web browsers?
A: You can find the supported browser list in the following Microsoft article: https://docs.microsoft.com/en-us/aspnet/core/blazor/supported-platforms (Microsoft Internet Explorer 11 and older versions are not supported).
We test 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).
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:
Q: Can I deploy XAF Blazor apps to Google or Apple stores?
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.
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.
Q: What are deployment recommendations for Blazor Server apps?
A: Refer to the following article for details: Deployment Recommendations for XAF Blazor UI Applications.
Supported Identity Providers
Q: Does XAF’s Blazor UI support OAuth2 (Microsoft 365 or Google) 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 by Manuel Grundner (DevExpress MVP).
Q: How do I access services from a built-in ASP.NET Core service container (IServiceProvider)?
A: To access IServiceProvider, use the following code:
((BlazorApplication)yourXafApplicationInstance).ServiceProvider. For more information, see Dependency Injection.
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 IHttpClientFactory to make HTTP requests.
Customize Pop-Up Dialogs
Q: How do I resize popup dialogs? Can I increase the default window width if it contains a complex form?
“Save & New” and “Save & Close” Buttons
Q: How do I return the “Save & New” and “Save & Close” buttons in DetailView (as it was in WinForms and WebForms)?