expressappframework-404103-debugging-testing-and-error-handling-code-diagnostics-xaf0022.md
Severity: Warning
Avoid using the ShowViewStrategy.ShowView method. It is for internal use.
To display a View in the XAF UI, use Actions, ShowViewInPopupWindow, ShowMessage, etc. Refer to the following topic for details: Ways to Show a View.
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp;
using DevExpress.Xpo;
namespace TestApplication.Module.PlatformSpecificModulesTest {
public class TestClass {
public XafApplication Application { get; set; }
void Show(DashboardView view) {
ShowViewParameters svp = new ShowViewParameters(view);
svp.Context = TemplateContext.ApplicationWindow;
svp.CreateAllControllers = true;
// Avoid using Application.ShowViewStrategy.ShowView
Application.ShowViewStrategy.ShowView(svp, new ShowViewSource(null, null)); // Warning
}
}
}
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp;
using DevExpress.Xpo;
namespace TestApplication.Module.PlatformSpecificModulesTest {
public class TestClass {
public XafApplication Application { get; set; }
void Show(DashboardView view) {
// This code meets the requirements
Application.ShowViewStrategy.ShowViewInPopupWindow(view);
}
}
}
To display a View in the XAF UI, use Actions, ShowViewInPopupWindow, ShowMessage, etc. Refer to the following topic for details: Ways to Show a View.
See Also