This example demonstrates how to create a custom DocumentManager. Once you place this component onto a form, you can switch (convert) the current View to WidgetView
using a smart tag menu. When you create new documents at design time or runtime, custom documents will be created. For demonstration purposes, the example adds a new custom property to the custom Document
class.
[ToolboxItem(true)]
public class CustomDocumentManager : DocumentManager {
public CustomDocumentManager() { }
public CustomDocumentManager(IContainer container)
: base(container) {
}
protected override void RegisterViews() {
base.RegisterViews();
RegisterView<CustomWidgetViewRegistrator>(ViewType.Widget);
}
public override BaseView CreateView(ViewType type) {
if (type == ViewType.Widget) return new CustomWidgetView(Container);
return base.CreateView(type);
}
}
(you will be redirected to DevExpress.com to submit your response)