As far as I know, the designer (that obviously does not run on .NET CF) uses the controls from the full framework under the hood. There is some sort of mapping that applies custom attributes for .NET CF using a DesigntimeAttributes.xmta
. This way they did not have to port all the designers to CF.
This link shows how you can generate a DesigntimeAttributes.xmta
using the "View class diagram" feature, and this link has some additional information about editing the file.
In short, you add a DesigntimeAttributes.xmta
file to your project with something like:
<Classes xmlns="http://schemas.microsoft.com/VisualStudio/2004/03/SmartDevices/XMTA.xsd">
<Class Name="MyProject.MyCustomControl">
<DefaultEvent>MyDefaultEvent</DefaultEvent>
</Class>
</Classes>
As for the genasm.exe
error you were having, this link contains information and the steps to reproduce it. I created a method that returns an SqlCeCommand
(I assume that's what your CommandCollection
property returns) and get the same error. When I change that method to return DbCommand
instead, the error disappears.
If you can get away with replacing every SqlCeCommand
to DbCommand
(and all other types from the family) you might want to go there - but the workarounds seem quite heavy for just adding a default event.