huoxudong125
huoxudong125

Reputation: 2056

How to find the WPF Custom Control template in Add new Item dialog?

When I want to create a custom control(not user control),I can't find Custom Control tempalte in Add New Item dialog .

How to find or add the custom control template for WPF in Add New Item dialog ?

Add new Item no <code>CustomControl</code>

Upvotes: 1

Views: 1414

Answers (2)

ghord
ghord

Reputation: 13817

If you have existing project and you don't want to reacreate it, add following line to <PropertyGroup> in your .csproj file.

<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Then add following line to AssemblyInfo.cs to make sure your themes are working

[assembly: ThemeInfo( ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

Upvotes: 3

Dour High Arch
Dour High Arch

Reputation: 21712

A WPF Custom Control is a project type; you add one to a Solution with Add / New Project. It looks like you're trying to add a single file to a Project with Add / New Item.

Upvotes: 1

Related Questions