diff --git a/build/common.ps1 b/build/common.ps1
index 830b6ce270..0afe55f120 100644
--- a/build/common.ps1
+++ b/build/common.ps1
@@ -31,6 +31,8 @@ if ($full -eq "-f")
"../modules/blogging",
"../templates/module/aspnet-core",
"../templates/app/aspnet-core",
+ "../templates/console",
+ "../templates/wpf",
"../abp_io/AbpIoLocalization"
)
}else{
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
index 106d7b5bcc..0462920fbb 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
@@ -14,6 +14,7 @@ using Volo.Abp.Cli.Http;
using Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Templates.Console;
using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule;
+using Volo.Abp.Cli.ProjectBuilding.Templates.Wpf;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Http;
using Volo.Abp.IO;
@@ -244,7 +245,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
stringBuilder.AppendLine(cacheFile);
}
- var matches = Regex.Matches(stringBuilder.ToString(), $"({AppTemplate.TemplateName}|{AppProTemplate.TemplateName}|{ModuleTemplate.TemplateName}|{ModuleProTemplate.TemplateName}|{ConsoleTemplate.TemplateName})-(.+).zip");
+ var matches = Regex.Matches(stringBuilder.ToString(), $"({AppTemplate.TemplateName}|{AppProTemplate.TemplateName}|{ModuleTemplate.TemplateName}|{ModuleProTemplate.TemplateName}|{ConsoleTemplate.TemplateName}|{WpfTemplate.TemplateName})-(.+).zip");
foreach (Match match in matches)
{
templateList.Add((match.Groups[1].Value, match.Groups[2].Value));
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs
index d1c2e4e2ba..7a4df335fe 100644
--- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/TemplateInfoProvider.cs
@@ -3,6 +3,7 @@ using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.Cli.ProjectBuilding.Templates.App;
using Volo.Abp.Cli.ProjectBuilding.Templates.Console;
using Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule;
+using Volo.Abp.Cli.ProjectBuilding.Templates.Wpf;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.ProjectBuilding
@@ -28,6 +29,8 @@ namespace Volo.Abp.Cli.ProjectBuilding
return new ModuleProTemplate();
case ConsoleTemplate.TemplateName:
return new ConsoleTemplate();
+ case WpfTemplate.TemplateName:
+ return new WpfTemplate();
default:
throw new Exception("There is no template found with given name: " + name);
}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Wpf/WpfTemplate.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Wpf/WpfTemplate.cs
new file mode 100644
index 0000000000..db1a257b89
--- /dev/null
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Wpf/WpfTemplate.cs
@@ -0,0 +1,16 @@
+namespace Volo.Abp.Cli.ProjectBuilding.Templates.Wpf
+{
+ public class WpfTemplate : WpfTemplateBase
+ {
+ ///
+ /// "wpf".
+ ///
+ public const string TemplateName = "wpf";
+
+ public WpfTemplate()
+ : base(TemplateName)
+ {
+ DocumentUrl = CliConsts.DocsLink + "/en/abp/latest/Getting-Started-WPF-Application";
+ }
+ }
+}
diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Wpf/WpfTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Wpf/WpfTemplateBase.cs
new file mode 100644
index 0000000000..e7127bb23b
--- /dev/null
+++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Wpf/WpfTemplateBase.cs
@@ -0,0 +1,13 @@
+using JetBrains.Annotations;
+using Volo.Abp.Cli.ProjectBuilding.Building;
+
+namespace Volo.Abp.Cli.ProjectBuilding.Templates.Wpf
+{
+ public class WpfTemplateBase: TemplateInfo
+ {
+ protected WpfTemplateBase([NotNull] string name) :
+ base(name)
+ {
+ }
+ }
+}
diff --git a/templates/wpf/.gitattributes b/templates/wpf/.gitattributes
new file mode 100644
index 0000000000..c941e52669
--- /dev/null
+++ b/templates/wpf/.gitattributes
@@ -0,0 +1 @@
+**/wwwroot/libs/** linguist-vendored
diff --git a/templates/wpf/.gitignore b/templates/wpf/.gitignore
new file mode 100644
index 0000000000..95d81cb113
--- /dev/null
+++ b/templates/wpf/.gitignore
@@ -0,0 +1,255 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# MyProjectName
+src/MyCompanyName.MyProjectName.ConsoleApp/Logs/logs.txt
diff --git a/templates/wpf/MyCompanyName.MyProjectName.sln b/templates/wpf/MyCompanyName.MyProjectName.sln
new file mode 100644
index 0000000000..6110c63271
--- /dev/null
+++ b/templates/wpf/MyCompanyName.MyProjectName.sln
@@ -0,0 +1,21 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName", "src\MyCompanyName.MyProjectName\MyCompanyName.MyProjectName.csproj", "{7CC4F9BA-520E-4D2E-92A5-8B91BFA08CBF}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{25D4C66E-2173-478D-ABBE-0E9FC0E93B57}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7CC4F9BA-520E-4D2E-92A5-8B91BFA08CBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7CC4F9BA-520E-4D2E-92A5-8B91BFA08CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7CC4F9BA-520E-4D2E-92A5-8B91BFA08CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7CC4F9BA-520E-4D2E-92A5-8B91BFA08CBF}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {7CC4F9BA-520E-4D2E-92A5-8B91BFA08CBF} = {25D4C66E-2173-478D-ABBE-0E9FC0E93B57}
+ EndGlobalSection
+EndGlobal
diff --git a/templates/wpf/common.props b/templates/wpf/common.props
new file mode 100644
index 0000000000..233f41c1ba
--- /dev/null
+++ b/templates/wpf/common.props
@@ -0,0 +1,12 @@
+
+
+ latest
+ 0.1.0
+ $(NoWarn);CS1591;CS0436
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/App.xaml b/templates/wpf/src/MyCompanyName.MyProjectName/App.xaml
new file mode 100644
index 0000000000..7637433bab
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/App.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/App.xaml.cs b/templates/wpf/src/MyCompanyName.MyProjectName/App.xaml.cs
new file mode 100644
index 0000000000..b76f8832e4
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/App.xaml.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Serilog;
+using Serilog.Events;
+using Volo.Abp;
+
+namespace MyCompanyName.MyProjectName
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ private readonly IHost _host;
+ private readonly IAbpApplicationWithExternalServiceProvider _application;
+
+ public App()
+ {
+ _host = Host
+ .CreateDefaultBuilder(null)
+ .UseAutofac()
+ .UseSerilog()
+ .ConfigureServices((hostContext, services) =>
+ {
+ services.AddApplication();
+ }).Build();
+ _application = _host.Services.GetService();
+ }
+
+ protected override async void OnStartup(StartupEventArgs e)
+ {
+ Log.Logger = new LoggerConfiguration()
+#if DEBUG
+ .MinimumLevel.Debug()
+#else
+ .MinimumLevel.Information()
+#endif
+ .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
+ .Enrich.FromLogContext()
+ .WriteTo.Async(c => c.File("Logs/logs.txt"))
+ .CreateLogger();
+
+ try
+ {
+ Log.Information("Starting WPF host.");
+ await _host.StartAsync();
+ Initialize(_host.Services);
+
+ _host.Services.GetService()?.Show();
+
+ }
+ catch (Exception ex)
+ {
+ Log.Fatal(ex, "Host terminated unexpectedly!");
+ }
+ finally
+ {
+ Log.CloseAndFlush();
+ }
+ }
+
+ protected override async void OnExit(ExitEventArgs e)
+ {
+ _application.Shutdown();
+ await _host.StopAsync();
+ _host.Dispose();
+ }
+
+ private void Initialize(IServiceProvider serviceProvider)
+ {
+ _application.Initialize(serviceProvider);
+ }
+ }
+}
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/AssemblyInfo.cs b/templates/wpf/src/MyCompanyName.MyProjectName/AssemblyInfo.cs
new file mode 100644
index 0000000000..4a05c7d474
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
\ No newline at end of file
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/HelloWorldService.cs b/templates/wpf/src/MyCompanyName.MyProjectName/HelloWorldService.cs
new file mode 100644
index 0000000000..d2d4275def
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/HelloWorldService.cs
@@ -0,0 +1,12 @@
+using Volo.Abp.DependencyInjection;
+
+ namespace MyCompanyName.MyProjectName
+{
+ public class HelloWorldService : ITransientDependency
+ {
+ public string SayHello()
+ {
+ return "Hello world!";
+ }
+ }
+}
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/MainWindow.xaml b/templates/wpf/src/MyCompanyName.MyProjectName/MainWindow.xaml
new file mode 100644
index 0000000000..f716edebb5
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/MainWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/MainWindow.xaml.cs b/templates/wpf/src/MyCompanyName.MyProjectName/MainWindow.xaml.cs
new file mode 100644
index 0000000000..be1004415d
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/MainWindow.xaml.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace MyCompanyName.MyProjectName
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ private readonly HelloWorldService _helloWorldService;
+
+ public MainWindow(HelloWorldService helloWorldService)
+ {
+ _helloWorldService = helloWorldService;
+ InitializeComponent();
+ }
+
+ protected override void OnContentRendered(EventArgs e)
+ {
+ HelloLabel.Content =_helloWorldService.SayHello();
+ }
+ }
+}
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/MyCompanyName.MyProjectName.csproj b/templates/wpf/src/MyCompanyName.MyProjectName/MyCompanyName.MyProjectName.csproj
new file mode 100644
index 0000000000..ccd53a9e86
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/MyCompanyName.MyProjectName.csproj
@@ -0,0 +1,29 @@
+
+
+
+
+
+ WinExe
+ net5.0-windows
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/MyProjectNameModule.cs b/templates/wpf/src/MyCompanyName.MyProjectName/MyProjectNameModule.cs
new file mode 100644
index 0000000000..1687f50583
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/MyProjectNameModule.cs
@@ -0,0 +1,15 @@
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.Autofac;
+using Volo.Abp.Modularity;
+
+namespace MyCompanyName.MyProjectName
+{
+ [DependsOn(typeof(AbpAutofacModule))]
+ public class MyProjectNameModule : AbpModule
+ {
+ public override void ConfigureServices(ServiceConfigurationContext context)
+ {
+ context.Services.AddSingleton();
+ }
+ }
+}
diff --git a/templates/wpf/src/MyCompanyName.MyProjectName/appsettings.json b/templates/wpf/src/MyCompanyName.MyProjectName/appsettings.json
new file mode 100644
index 0000000000..d177980a92
--- /dev/null
+++ b/templates/wpf/src/MyCompanyName.MyProjectName/appsettings.json
@@ -0,0 +1,3 @@
+{
+
+}