1

Is it possible to add definition of WPF Custom Control to dll?

There is no such a template in Visual Studio 2015. Only template "WPF User Control" is avaiable, but I don't want to create control from scratch but modernize existing standard control.

iljon
  • 398
  • 2
  • 16

2 Answers2

3

The following project types exist that might fit your needs:

  • WPF Custom Control Library: Custom controls extend one of the WPF control base classes and provide additional functionality through code.
  • WPF User Control Library: A user control is technically a normal content control which you can extend in some parts in the code but usually it is extended by placing other controls inside of it.

See this answer for more information: What is the difference between a User Control Library and a Custom Control Library?

Community
  • 1
  • 1
Aetherix
  • 2,150
  • 3
  • 24
  • 44
  • It is possible to place few custom control definitions and also some user controls and other classes to one WPF Custom Control Library, isn't it? Or it is not recommended. – iljon Mar 16 '16 at 12:58
0

If I understand you correct, you want to create a User Control based on XAML. In my Visual Studio, this template is called "User Control WPF" and yes, you can add it to a Dll.

To modernize an existing control it might be simple to modifiy the style and ControlTemplate of this control. You can extract style and control template using Blend and then modify it to your needs.

unkreativ
  • 482
  • 2
  • 8
  • That's right but I'd like to define some additional properites, which is possible only in code-behind. And I'd like to move my existing definition of CustomControl to dll for future use. – iljon Mar 16 '16 at 09:36