Has anyone ever tried to implement ICommandSource with VB?
The examples provided by Microsoft are in C#, and since VB doesn’t allow implicit implementation this interface is like inachievable in VB!!
Has anyone ever tried to implement ICommandSource with VB? The examples provided by Microsoft
Share
It depends on what class you want to implement it on. If you’re introducing the Command, CommandParameter and CommandTarget properties in your own class (where you’re implementing the interface), you can just implement it like any other interface:
You can still use a DP for the implementation, by the way: the Implements directive is on the CLR property and does not interfere with the “do not touch” implementation of the getters and setters.
If the class you want to implement it on already has (inherited) Command, CommandParameter and CommandTarget properties, and you want the interface implementation to reuse those, you’ll need to create new properties with new names, declare them as interface implementations and back them onto the existing properties