Back to Devexpress

XPServerModeView.ResolveSession Event

xpo-devexpress-dot-xpo-dot-xpservermodeview-2c461d8a.md

latest3.8 KB
Original Source

XPServerModeView.ResolveSession Event

Occurs when the XPServerModeView requests a Session to retrieve objects from the data store.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public event ResolveSessionEventHandler ResolveSession
vb
Public Event ResolveSession As ResolveSessionEventHandler

Event Data

The ResolveSession event's data class is ResolveSessionEventArgs. The following properties provide information specific to this event:

PropertyDescription
SessionSpecifies the session to be used to load and save persistent objects.

Remarks

The event is raised when the XPServerModeView requests a Session to retrieve objects from the data store, and the Session property is not specified.

You can handle this event when you create an XPServerModeView at design time and want to associate it with a Session or UnitOfWork created at runtime.

If the session is not specified, the XPServerModeView uses the default session (Session.DefaultSession).

Note

Do not change the XPServerModeView.Session property manually in code, as it is intended to provide design-time support for the component. A session that the view will work with can be initialized in the XPView‘s constructor or within the ResolveSession event handler.

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

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.

XPO_how-to-bind-data-to-winforms-controls-using-xpservermodeview-or-xpinstantfeedbackview/CS/XPServerModeViewDemo/Form1.cs#L19

csharp
session = new Session(XpoDefault.DataLayer);
xpServerModeView1.ResolveSession += (s, e) => {
    e.Session = session;

XPO_how-to-bind-data-to-winforms-controls-using-xpservermodeview-or-xpinstantfeedbackview/VB/XPServerModeViewDemo/Form1.vb#L21

vb
session = New Session(XpoDefault.DataLayer)
AddHandler xpServerModeView1.ResolveSession, Sub(s, e)
    e.Session = session

See Also

XPServerModeView Class

XPServerModeView Members

DevExpress.Xpo Namespace