expressappframework-devexpress-dot-expressapp-dot-xafapplication-02acb8ff.md
Provides access to IServiceProvider.
Namespace : DevExpress.ExpressApp
Assembly : DevExpress.ExpressApp.v25.2.dll
NuGet Package : DevExpress.ExpressApp
[Browsable(false)]
public IServiceProvider ServiceProvider { get; set; }
<Browsable(False)>
Public Property ServiceProvider As IServiceProvider
| Type | Description |
|---|---|
| IServiceProvider |
An object that implements the IServiceProvider interface.
|
Use this property to obtain an instance of IServiceProvider. For more information, see the following topic: Dependency Injection (DI).
Note
To use this property in an XAF Windows Forms application, make sure that your application contains an integrated application builder.
You may find the following examples helpful:
The following code snippets (auto-collected from DevExpress Examples) contain references to the ServiceProvider 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.
protected override void PrintReport(IReportDataV2 reportData) {
var reportStorage = ReportDataProvider.GetReportStorage(Application.ServiceProvider);
XtraReport report = reportStorage.LoadReport(reportData);
if (resultsHighlightController != null) {
IRuleSet ruleSet = Validator.GetService(Application.ServiceProvider);
RuleSetValidationResult result = ruleSet.ValidateAllTargets(ObjectSpace, targets, DefaultContexts.Save);
See Also