Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Is it possible to create a custom control WPF in a class library project?

$
0
0

I have a test project that is a WPF project, in which I add a new item, a custom control (WPF). This creates a generic.axml file and the .cs with the code that controls the bussiness logic (MVVM pattern).

Now I wanted to create a library with few custom controls to be able to use in many WPF applications, so I have created a class library project. Then I will to add a new item, but now I don't have the option to select custom control (WPF), just user control. This create an axml with a designer.cs file, but I would like to have the separate the two files, one side the generic.axml and in other side the .cs file.

So I am wondering if it is possible to have a class library with custom controls or only with user controls.

I have readed that user control is not the same than custom control, but perhaps I missuderstood something.

So my question is, can I create a custom control in a class library project? if not, how can I create a kind of project that contains many custom controls? Or I have to craete a user control in a class library? Is the same a custom control and a user control?

Thanks.

EDIT: i have found this thread: https://social.msdn.microsoft.com/Forums/vstudio/en-US/dfb1029f-4c94-4ab4-aca5-3d2f5b41fd07/how-to-create-a-wpf-custom-control-library?forum=wpf

But I don't have the option of classic windows. I am using VS2015 Community update 3.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>