Beispiel #1
0
        public static ObjectView CreateObjectView(this DevExpress.ExpressApp.XafApplication application,
                                                  Type viewType, Type objectType)
        {
            if (viewType == typeof(ListView))
            {
                var listViewId       = application.FindListViewId(objectType);
                var collectionSource = application.CreateCollectionSource(application.CreateObjectSpace(), objectType, listViewId);
                return(application.CreateListView((IModelListView)application.Model.Views[listViewId], collectionSource, true));
            }
            var modelDetailView = application.Model.BOModel.GetClass(objectType).DefaultDetailView;

            return(application.CreateDetailView(application.CreateObjectSpace(), modelDetailView, true));
        }
Beispiel #2
0
 public void Setup(DevExpress.ExpressApp.CollectionSourceBase CollectionSource, DevExpress.ExpressApp.XafApplication Application)
 {
     _collectionSourceBase = CollectionSource;
     _objectSpace          = Application.CreateObjectSpace();
     _application          = Application;
     this._statuses        = this._objectSpace.GetObjects <Status>(null);
 }
Beispiel #3
0
        public static DetailView NewDetailView(this DevExpress.ExpressApp.XafApplication application, object currentObject, IModelDetailView modelDetailView = null, bool isRoot = true)
        {
            var objectSpace = application.CreateObjectSpace();

            modelDetailView ??= application.FindModelDetailView(currentObject.GetType());
            var detailView = application.CreateDetailView(objectSpace, modelDetailView, isRoot);

            detailView.CurrentObject = objectSpace.GetObject(currentObject);
            return(detailView);
        }