Hi,
I searched in the documentation and issues here, but can't find a way to achieve this. Is this possible ?
Let's say I have 2 objects : Address & Client. Client Inherits from Client.
I created 2 viewcontrollers in the App.Module : ViewControllerAddress & ViewControllerClient. Again the ViewControllerClient inherits from ViewControllerAddress.
Now if I want to override some method in the Address ViewController for the Win App only, can I do this ? I could create a new ViewController inheriting from the ClientViewController and overrid the method, but than I would have to do this for all the ViewControllers that inherit from Address.
thanks for your help
Xavier
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.
Hi Xavier,
>>
Now if I want to override some method in the Address ViewController for the Win App only, can I do this ?
<<
No, you cannot. I suggest you create three controllers for this purpose: one, a base controller which will implement a common logic for both platforms, and two Win/Web specified controllers derived from the base controller. For instance, our standard DetailViewController, WinDetailViewController and the WebDetailViewController controllers are designed in this way. This allows you to provide /alter a functionality faster, and makes your code simpler.
Thanks
Dennis
Ok, I understand. But what I'm trying to do alos is create one ViewController and use it for all screens that are based on the "Address" objecttype (like client, contacts, transporter, …). For now I haven't found a solution except create a separate controler for each object and base it on a standard (address) controller. It would be nice however if I could create one controller and select multiple objecttypes to apply it to. Can I do this ?
Greetings
Xavier
If found that this solution works for me :
- I set the ViewController to be used for all detailviews
- Create an array of TargetTypes like :
string[] arrayTargetTypes = { "Client", "Contact", "Transporter"};
- Check in the Controls_Created if the type is of the TargetType
if (Array.IndexOf(arrayTargetTypes, View.ObjectType.Name) >= 0) {…}
Maybe it's still intresting to allow multiple TargetObjectTypes through the designer.
Greetings
Xavier
Hi Xavier,
Yes, your solution is almost right: I suggest you move this condition into the overridden OnActivated method instead of placing this code within the View.ControlsCreated event handler.
>>
Maybe it's still intresting to allow multiple TargetObjectTypes through the designer.
<<
You are free to add a suggestion in this regard.
Thanks
Dennis