Ejemplo n.º 1
0
        void ShowSerializationView(SingleChoiceActionExecuteEventArgs singleChoiceActionExecuteEventArgs)
        {
            var groupObjectType    = XafTypesInfo.Instance.FindBussinessObjectType <ISerializationConfigurationGroup>();
            var showViewParameters = singleChoiceActionExecuteEventArgs.ShowViewParameters;

            showViewParameters.TargetWindow = TargetWindow.NewModalWindow;
            View view;

            if (ObjectSpace.FindObject(groupObjectType, null) == null)
            {
                IObjectSpace objectSpace         = Application.CreateObjectSpace(XafTypesInfo.Instance.FindBussinessObjectType <ISerializationConfigurationGroup>());
                var          objectFromInterface = objectSpace.CreateObjectFromInterface <ISerializationConfigurationGroup>();
                view = Application.CreateDetailView(objectSpace, objectFromInterface);
            }
            else
            {
                IObjectSpace objectSpace = Application.CreateObjectSpace(groupObjectType);
                view = Application.CreateListView(objectSpace, groupObjectType, true);
            }
            showViewParameters.CreatedView = view;
            AddDialogController(showViewParameters);
        }