[XAF] Keep the DetailView open in a popup window

 public class ViewController1 : ViewController
    {
        ListViewProcessCurrentObjectController controller;
        protected override void OnActivated()
        {
            base.OnActivated();
            controller = Frame.GetController<ListViewProcessCurrentObjectController>();
            controller.CustomizeShowViewParameters += controller_CustomizeShowViewParameters;
        }
        void controller_CustomizeShowViewParameters(object sender, CustomizeShowViewParametersEventArgs e)
        {
            e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
        }
        protected override void OnDeactivated()
        {
            controller.CustomizeShowViewParameters -= controller_CustomizeShowViewParameters;
            base.OnDeactivated();
        }
    }

    public class MyNewObjectViewController : WinNewObjectViewController
    {
        protected override void New(SingleChoiceActionExecuteEventArgs args)
        {
            base.New(args);
            args.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow;
        }
    }

 

你可能感兴趣的:(window)