user1795293
user1795293

Reputation: 43

Xaml designer in windows phone 8.0 (cannot create an instance of my custom control)

I'm creating a custom control for windows phone 8, in this control I use a class from a Windows Runtime Component (.winmd).

The problem is in the xaml designr my custom control not appear, but the control works fine in rut mode.

(As I mentioned above this is in design time (Xaml designer)) :

"Cannot create instance of MyControl", and the inner exception is:

TypeLoadException: Requested Windows Runtime type "WindowsPhoneRuntimeComponent1.WindowsPhoneRuntimeComponent" is not registered.

Upvotes: 1

Views: 799

Answers (1)

Claus Jørgensen
Claus Jørgensen

Reputation: 26344

The designer can't initialize WinRT (COM) objects. You'll have to use the DesignerProperties.IsInDesignTool to prevent your WinRT objects being instantiated while in design mode.

Upvotes: 1

Related Questions