[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Collapse]eXpressApp Framework
 [Expand]Getting Started
  [Expand]Application Solution Components
  [Collapse]Business Model Design
    Business Model Design Basics
    Built-in Business Classes for Most Popular Scenarios
   [Expand]Business Model Design with Entity Framework
   [Expand]Business Model Design with XPO
    Non-Persistent Objects
    PropertyChanged Event in Business Classes
   [Expand]Data Types Supported by built-in Editors
    Mapping Complex Types to the Database
   [Expand]Types Info Subsystem
    Connect an XAF Application to a Database Provider
    Data Annotations in Data Model
    Create and Update the Application's Database
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Controllers and Actions
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging, Testing and Error Handling
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Task-Based Help
  Frequently Asked Questions (FAQ)
 [Expand]API Reference
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

PropertyChanged Event in Business Classes

To provide a consistent user interface, your XAF application must receive notifications from business classes when their property values are changed. For instance, Conditional Appearance and Validation modules may require an immediate UI update when a user modifies a certain value. This topic describes how to provide notifications from XPO, Entity Framework and non-persistent business classes.

The notification mechanism is based on supporting the standard INotifyPropertyChanged interface and implementing its declared PropertyChanged event. To send a notification to internal XAF code, trigger PropertyChanged from a property set accessor within a business class.

Expanded PropertyChanged Event in XPO

There is no need to implement the INotifyPropertyChanged interface manually in an XPO business class. When you declare an XPO business class, you inherit BaseObject (or another base persistent class) that already supports this interface. You can trigger the PropertyChanged event from a property set accessor by executing the XPBaseObject.OnChanged or PersistentBase.SetPropertyValue helper method.

See Also: Simplified Property Syntax

Expanded PropertyChanged Event in Entity Framework

When implementing an EntityFramework business class, you do not inherit any standard base class. Thus, you should implement the INotifyPropertyChanged interface manually. XAF provides the XAF Business Object | EF Business Object project item template to simplify this task.

In an existing class, you can implement INotifyPropertyChanged as follows.

You can use the OnPropertyChanged helper method to trigger the PropertyChanged event from a property set accessor.

Expanded PropertyChanged Event in Non-Persistent Classes

To use the PropertyChanged event in a non-persistent class, follow the same approach which is described above for the Entity Framework.

To create a new non-persistent class that supports INotifyPropertyChanged, use the XAF Business Object | Non-Persistent Object project item template.

Is this topic helpful?​​​​​​​