DevExpress XAF Navigate

Date: 2022-12-07
public class ProductBrandListViewController : BasicViewController<ListView>
{
    private void ShowDetailView(string viewName, XPLiteObject xpObject)
    {
        var objectSpace = (XPObjectSpace)Application.CreateObjectSpace();
        var copiedObject = objectSpace.GetObject(xpObject);
        var svpInternal = new ShowViewParameters
        {
            CreatedView = Application.CreateDetailView(objectSpace, viewName, true, copiedObject),
            TargetWindow = TargetWindow.Default,
            Context = TemplateContext.View,
        };
        ((DetailView)svpInternal.CreatedView).ViewEditMode = ViewEditMode.Edit;
        Application.ShowViewStrategy.ShowView(svpInternal, new ShowViewSource(this.Frame, this.OpenRelatedProductAction));
    }
    
    private void ShowDetailViewInNewWindow(string viewName, XPLiteObject xpObject)
    {
        var objectSpace = (XPObjectSpace)Application.CreateObjectSpace();
        var svpInternal = new ShowViewParameters
        {
            CreatedView = Application.CreateDetailView(objectSpace, viewName, true, xpObject),
            TargetWindow = TargetWindow.NewModalWindow,
            Context = TemplateContext.View
        };
        ((DetailView)svpInternal.CreatedView).ViewEditMode = ViewEditMode.Edit;
        Application.ShowViewStrategy.ShowView(svpInternal, new ShowViewSource(null, null));
    }
}


// Example 2
private void PopupCallIntakeShowAction_Execute(object sender, SimpleActionExecuteEventArgs e)
{
    IObjectSpace os = Application.CreateObjectSpace();
    var detailView = Application.CreateDetailView(os, os.CreateObject<CallIntake>());
    detailView.Model.CustomizationEnabled = false;
    var svp = new ShowViewParameters();
    svp.CreatedView = detailView;
    svp.TargetWindow = TargetWindow.NewModalWindow;
    svp.CreateAllControllers = true;
    svp.Context = TemplateContext.PopupWindow;
    var svs = new ShowViewSource(null, null);
    Application.ShowViewStrategy.ShowView(svp, svs);
}

70650cookie-checkDevExpress XAF Navigate