How to compile a WPF application into a class library and run the application if necessary

I am wondering how to compile a WPF application into an independent shared class library (dll)? Any sample?

+5
source share
2 answers
  • Solution Explorer → Right-click on “MySolution” → Add → New Project → WPF User Interface Library
    Add your controls there and use them from any other application.

  • Converting the current project to dll: Solution Explorer → MyWpfApplication → Right-click → Properties → Application Tab → Output Type = Class Library

  • , exe. ( )

+5

, WPF dll , .

" ", WPF, DLL.

DLL, dll, App.xaml StartupUri Uri, dll.

<Application x:Class="WpfApplication13.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="pack://application:,,,/ReferencedAssembly;component/MainWindow.xaml">
    <Application.Resources>

    </Application.Resources>
</Application>
+5

All Articles