Back to Devexpress

SourceObjectContainer.SourceObject Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-sourceobjectcontainer-58533b97.md

latest2.9 KB
Original Source

SourceObjectContainer.SourceObject Property

Provides access to the data object bound to the current persistent instance.

Namespace : DevExpress.Xpf.Scheduling

Assembly : DevExpress.Xpf.Scheduling.v25.2.dll

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public object SourceObject { get; }
vb
Public ReadOnly Property SourceObject As Object

Property Value

TypeDescription
Object

A Object that is the data source object which is bound to the persistent object.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SourceObject property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-load-data-on-demand/CS/CommonDbContext/ViewModels/SchedulingViewModel.cs#L26

csharp
public void ProcessChanges(AppointmentCRUDEventArgs args) {
    dbContext.AppointmentEntities.AddRange(args.AddToSource.Select(x => (AppointmentEntity)x.SourceObject));
    dbContext.AppointmentEntities.RemoveRange(args.DeleteFromSource.Select(x => (AppointmentEntity)x.SourceObject));

wpf-scheduler-load-data-on-demand/VB/CommonDbContext/ViewModels/SchedulingViewModel.vb#L26

vb
Public Sub ProcessChanges(ByVal args As AppointmentCRUDEventArgs)
    dbContext.AppointmentEntities.AddRange(args.AddToSource.Select(Function(x) CType(x.SourceObject, AppointmentEntity)))
    dbContext.AppointmentEntities.RemoveRange(args.DeleteFromSource.Select(Function(x) CType(x.SourceObject, AppointmentEntity)))

See Also

SourceObjectContainer Class

SourceObjectContainer Members

DevExpress.Xpf.Scheduling Namespace