Ticket S91626
Visible to All Users

Designers.ViewController - allow controllers to have an interface as a target object type

created 17 years ago

To help consolidate UI code, sometimes it is possible to create an interface that can be implemented against multiple business classes and have a ViewController work against that interface. At the moment to set the controller active or inactive based on an interface some code has to be written in the controller activated event. One line of code, but perhaps it may be helpful to have it available from the UI.
Proposed Solution:
List interfaces in the TargetObjectType property to allow for controller activation based on an interface.

Answers approved by DevExpress Support

created 17 years ago (modified 11 years ago)

Hello Mark,
Currently, you can initialize the "TargetObjectType" property in code, for example:
  this.TargetObjectType = typeof(IReportData);
The standard "Reports" module works in this way.
However, the Controller designer doesn't show interfaces in the dropdown list for the "TargetObjectType". It's easy to collect all the business classes, because all of them are marked with [Persistent] or [NonPersistent] attributes and collected by XPO, while interfaces are not processed at all.
So, you can associate a controller with an interface in code. We will look into this inconsistency and see how to make it better.
See Also:
Core - Make it possible to activate the same ViewController or Action for multiple Views or target object types
Thanks, Dan.

    Comments (1)
    MK MK
    Mark Krasnohorsky 17 years ago

      Hi Dan,
      Thanks for the tip.
      MK

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.