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; } }
时间: 2024-11-11 00:35:54