How to setup xafari solution.

StatusIDPriorityType
Closed39702MajorQuestion
ProfileReply
James TimoClient

I have setup a new solution but can't get the dockpanel to show its view

Attached files:

Replies

UserDescriptionPosted On
MariyaVoytovichAgent

Hello!

To show Dock Panel in your application, you need to create a new class to Windows Forms Module Project, inherit it from DetailViewForm and implement IDockManagerHolder interface.
See documentation: Dock Panels. Win TabbedMDI

Feel free to contact us if you have any questions.

Regards,
Mariya
On behalf of Xafari Client Services Team

James TimoClient

I changed to SDI and empty.I think nonpersistent objects cannot be opened in dock panels.

MariyaVoytovichAgent

Hello!

Dock Panels Xafari use the DexExpress Dock Panels for their work.
Therefore, the detailed form template must support the DevExpress panel dock.
For this you need to add a new Detail View Template that will support the IDockManagerHolder interface.

I added such a template(TabbedMDIDetailViewForm) to your application and the dock panel was displayed for the non-persistent object.
Do the same for SDI.

See attached Project.

Regards,
Mariya
On behalf of Xafari Client Services Team

James TimoClient

Sample doesn't work.
I think xpobjectspace is created instead of nonpersistentobjectspace

MariyaVoytovichAgent

Can you give me more information?
1. The use case you are trying to implement.
2. Why do you think dock panels don't work for non-persistent objects?

Regards,
Mariya
On behalf of Xafari Client Services Team

James TimoClient

I checked the controller.
XPObjectSpace is created instead of NonPersistentObjectSpace

James TimoClient

Use case:
Am setting up a nonpersistent object with persistent object properties.
When user selects objects in this view using comboboxes,I will use this to filter the main view.this allows me to use as few dockpanels as possible.

MariyaVoytovichAgent

Hello!

XPObjectSpace is created by default, because when the panel is created the type object is not considered.

If you need create Object Space that supports a specific object type, you can create your own Detail View with the desired Object Space.

To do this, you need to subscribe to the CustomCreateView event of the XafariDockingWindowController. In the event handler, you need to create a Detail View.
For Exemple:

	public class CustomizeDockPanelsViewViewController : ViewController
	{
		private const string DockPanelAllowEditKey = "DockPanel AllowEdit";

		private XafariDockingWindowController _dockingController;
		protected override void OnActivated()
		{
			base.OnActivated();

			if ((this._dockingController = this.Frame.GetController<XafariDockingWindowController>()) != null)
			{
				this._dockingController.CustomCreateView += this._dockingController_CustomCreateView;
			}
		}

		private void _dockingController_CustomCreateView(object sender, CustomCreateViewEventArgs e)
		{
			var dockPanelItem = e.DockPanelItem;

			if (dockPanelItem.Model.View is IModelDetailView detailViewModel)
			{
				var objectSpace = this.Application.CreateObjectSpace(detailViewModel.ModelClass.TypeInfo.Type);
				var detailView = this.Application.CreateDetailView(objectSpace, detailViewModel, true);
				detailView.AllowEdit[DockPanelAllowEditKey] = dockPanelItem.Model.AllowEdit;
				e.View = detailView;
			}
		}

		protected override void OnDeactivated()
		{
			if (this._dockingController != null)
				this._dockingController.CustomCreateView -= this._dockingController_CustomCreateView;
			base.OnDeactivated();
		}
	}

Regards,
Mariya
On behalf of Xafari Client Services Team

James TimoClient

Great!!!

× This ticket is closed.

Write US