Quantcast
Channel: Developer Express Inc.
Viewing all articles
Browse latest Browse all 2401

XAF (Cross-Platform .NET App UI & Web API Service) — Early Access Preview (v25.1)

$
0
0

This post documents a few XAF-related features we expect to ship in early June and details what’s inside our Early Access Preview build. As you will note below, XAF-related focus areas remain Blazor, Entity Framework Core and Security. For additional information on what you can expect in v25.1, please refer to our June 2025 Roadmap.

If you own an active Universal Subscription, feel free to download this Early Access Preview (EAP) build at your convenience. If you own an active DXperience Subscription and would like to learn more about our Cross-Platform .NET App UI (XAF) or Web API Service, you can explore the features described herein by logging onto the DevExpress Download Manager and installing this EAP build in trial mode. Once you do, please tell us whether these new features address your business needs. Your feedback will help us fine-tune our implementation before official launch.

If you are using a trial and want to try these preview features today, you can purchase a DevExpress Universal license online (this will give you access to the early access preview build). If you own a non-Universal subscription and are ready to upgrade, email us at clientservices@devexpress.com for upgrade pricing.

ASP.NET Core Blazor UI

Grid List Editor Enhancements

The IModelSplitLayout.RelativePosition property determines the splitter's position in relation to the DetailView as a percentage. It is automatically set when a user adjusts the splitter and takes precedence over the pixel-based SplitterPosition property.

Our DxGridListEditor also adds the new "Best Fit" and "Clear Sorting" context menu commands for grid column headers.


Masks for Date and Time properties

XAF Blazor Date and Time Property Editors support masked input. The `EditMask` property now restricts user input and you can specify it in the Application Model: BOModel > YourBusinessClass > Property > `EditMask`. Furthermore, you can customize mask settings for `TimeOnly` - `TimeSpan` and `DateOnly` – `DateSpan` type pairs separately in code.

View.CustomizeViewItemControl<TimeSpanPropertyEditor>(this, editor => {
    // TimeSpan
    editor.DxTimeEditMaskProperties.DateTime.CaretMode = MaskCaretMode.Advancing;
    // TimeOnly
    editor.DxTimeEditMaskProperties.TimeOnly.CaretMode = MaskCaretMode.Regular;
});

ToolTip Attribute Enhancements

XAF Blazor v25.1 supports the following UI elements for the ToolTip attribute (and the IModelToolTip.ToolTip property in the Application Model):

  • Navigation groups and items
  • `DxGridListEditor` and `DxTreeListEditor` column headers
  • Layout group headers
    [ToolTip("View, assign or remove employees for the current task")]
    public virtual IList<Employee> Employees { get; set; } 

Action Shortcuts

XAF Blazor v25.1 supports keyboard shortcuts for Toolbar and Context Menu Action Controls. You can specify appropriate keystroke combinations in the Model Editor or in code. Examples:

  • New: "Ctrl+Shift+A"
  • Save: "Ctrl+Shift+S"
  • Logon: "Enter"
  • DialogOK: "Ctrl+Shift+Enter"
  • Refresh: "Ctrl+Shift+R"
  • Delete: "Ctrl+Delete"
  • NextObject: "Ctrl+Alt+RightArrow"
  • PreviousObject: "Ctrl+Alt+LeftArrow"
  • SaveAndClose: "Ctrl+Shift+Enter"

Enhanced Filtering by Non-Persistent Fields

FilterController (and other XAF APIs working with server-side criteria) now better process non-persistent business class properties in Client data access mode for EF Core. Once non-persistent properties are detected in ListView criteria, we will fully process it on the client side.

XAF Blazor v25.1 also removes non-persistent/non-aliased properties (see 1-2 below) from the FilterPropertyEditor menu/user selection for both EF Core and XPO ORM (for example, defined with the NotMapped attribute). Calculated properties defined with the PersistentAlias and Calculated attributes are NOT removed (see 3-4 below).

.NET Aspire Integration

Our XAF team has spent some time considering the functionality of Aspire, attempting to find the best integration points which will allow XAF developers to take advantage of the orchestration features Aspire offers out of the box. The team sees Aspire as a potential "1-click solution", a more modern alternative to some of the templates in the XAF Solution Wizard, which could achieve some of these goals:

  • Simplify long and error-prone setup processes like those we describe in our documentation for Azure App Service and Nginx support on Linux, as well as other popular web server configurations.
  • Provision required databases and other application resources for both development and deployment environments (for instance, using a Docker setup).

The team hopes that we will be able to save a lot of time for our customers, whether they use XAF or not! Right now, much of this is a moving target, since Microsoft continues to develop Aspire rapidly. At the same time, some functionality is already commonly used and can be considered stable, so for now we decided to publish some details that will help you make use of the Aspire tools in your own XAF projects. Please refer to the following articles:

EF Core Enhancements

Concurrency Control for EF Core

XAF Blazor/Windows Forms EF-Core based apps support Optimistic Concurrency control (on par with existing XPO ORM functionality). The functionality is enabled for all classes that implement the new `IOptimisticLock` interface (for example, all classes inherited from XAF’s `BaseObject`). You can use the OptimisticLockIgnore attribute to disable the functionality for selected classes or properties.

With OptimisticLockDetection and OptimisticLockHandling options you can fine-tune collision detection and merge strategies both on object-level and field-level. You can set up the combination of these options either in the Application Builder for all classes or use OptimisticLockAttribute (to specify a custom strategy for a specific class).

        builder.ObjectSpaceProviders
           .AddEFCore(options =>
           {
               options.PreFetchReferenceProperties();
               options.OptimisticLockDetection = OptimisticLockDetection.AllFields;
               options.OptimisticLockHandling = OptimisticLockHandling.Merge;
           })

Clone Object Module for EF Core

In v25.1, XAF Blazor and Windows Forms EFCore-based apps support the Clone command. With this, you can quickly copy data records including aggregated detail collections.

We unified cloning functionality and APIs for both ORMs, so XAF developers can use a single DevExpress.ExpressApp.CloneObject package. For more information, refer to T1276850 - Core - The DevExpress.ExpressApp.CloneObject.Xpo assembly and NuGet package have been renamed.


Easier Database Schema Updates When a New Class or Property Is Added (XPO Parity)

v25.1 simplifies database updates for EF Core developers (targeting XAF WinForms/Blazor or Web API Service-based apps). For instance, when you add a new business class or a property at design time, XAF will automatically apply EF Core migrations to the database in Debug mode (similar to XPO ORM functionality). This will save development time because no extra methods will be necessary, especially for frequent data model changes.

We also got rid of the redundant DBUpdater tool for .NET / .NET-based apps for EF Core and XPO ORM. XAF developers can now use the updateDatabase CLI command of the underlying application instead. This will simplify the developer experience for both deployment and maintenance because a single method will be used. For more information, refer to T1282681 - Database schema update behavior has changed for EF Core.

NOTE: Do not use this automatic update in Debug mode (or the -updateDatabase -forceUpdate keys of the underlying application) with production databases or other important data (if you wish to make changes to a production database, be certain to backup your data). You, the developer, are responsible for the application, database, network, and other configurations and data safety/consistency based on client, security, and environment requirements. We recommend that you review relevant database update procedures with your database administrators (DBA) and always follow network/database best-practice standards.

Easier Connection to Middle-Tier Server in Non-XAF Apps for EF Core

In a Middle Tier server architecture,  only the server has direct access to the database. DbContext and other EF Core CRUD APIs are still used in UI client app code (which interacts with the server remotely). Before passing data to the client’s DbContext, the server enforces security measures such as authentication, authorization, and data validation (powered by our .NET App Security API).

In v25.1, we implemented the MiddleTierClientBuilder that simplifies boilerplate code required to connect non XAF-powered WinForms/WPF apps to a Middle Tier Security Server (via XAF's Security System and EF Core). For more information, check out our WinForms non-XAF example. Our new Template Kit will also include the corresponding non-XAF project templates for WinForms/WPF in the final release.

Cross-Platform Enhancements

Support DataSourceXXX attributes for Enumeration Property Editors

XAF Blazor/WinForms v25.1 support the following attributes for our Enumeration Property Editors:

For example, you can filter your enumeration values with the DataSourceCriteria attribute and the following criteria: "Status != 0 and Status > 2", "Status In (0,1,2)", "Status != '@This.OtherSelectedStatus'", etc.

using DevExpress.Persistent.BaseImpl.EF;
using DevExpress.Data.Filtering;
using System.ComponentModel.DataAnnotations;

[DefaultClassOptions]
public class Order : BaseObject {
    [DataSourceCriteria("Status = ##Enum#MyNamespace.OrderStatus,Pending# || Status = ##Enum#MyNamespace.OrderStatus,Confirmed#")]
    public virtual OrderStatus Status { get; set; }
}
public enum OrderStatus { Pending, Confirmed, Processing, Shipped, Delivered, Canceled, Returned }

New Built-in Property Editors: TagBox and Checked ComboBox

XAF Blazor/WinForms v25.1 ship with the built-in Tag Box and Checked ComboBox Property Editors. TagBox and Checked ComboBox are two popular options to save space in detail forms for collection data (as an alternative to large data grids).

All new Editors support CRUD operations, Security System, Application Model options such as `AllowEdit` or `AllowClear`, `DataSourceXXX` filtering attributes, ImmediatePostData and other standard XAF features.

Web API Service Enhancements

Our Backend Web API Service introduces the following highly-requested usability features (for EF Core in this EAP, for XPO in the final release):

  • OData Deep Insert and Deep Update  (for the Post, Patch and Put HTTP verbs).
  • OData Batch Operations (aka Batch Update support). Now you can use the new Patch(DeltaSet<TEntity> deltaSet) method to create/update large amounts of objects.

Your Feedback Matters!

Early Access and CTP builds are provided solely for early testing purposes and are not ready for production use. This build can be installed side by side with other major versions of DevExpress products. Please backup your project and other important data before installing Early Access and CTP builds. This EAP may not include all features/products we expect to ship in our v25.1 release cycle. As its name implies, the EAP offers an early preview of what we expect to ship in two months.

We recommend you try out the new features using Visual Studio 2022 and either MainDemo.NET.EFCore or MainDemo.NET.XPO demo (located in the following folder: "c:\Users\Public\Documents\DevExpress Demos 25.1\Components\XAF\"). You can also test the EAP build against your project, but please remember that this build is not ready for production use.

We will keep you posted about additional features we expect to ship in v25.1 (see our June 2025 Roadmap) as we get closer to official release. If you've had the opportunity to use the EAP build, please post your thoughts in our roadmap survey OR create a Support Center ticket. We will happily follow up.

Thanks,
Dennis Garavsky
Principal Product Manager
dennis@devexpress.com


Viewing all articles
Browse latest Browse all 2401

Trending Articles