diff --git a/README.md b/README.md index 2ae213b..33d32c3 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,36 @@ It is inspired by [Caliburn.Micro](http://caliburnmicro.com/), and shares many o Getting Started --------------- -### .NET Framework +### .NET 5.0+ / .NET Core + +For .NET Core and .NET 5.0+ projects, the quickest way to get started is by using `dotnet new` with Stylet's template. + +Open a command window where you want to create your new project, and install the Stylet templates using: + +``` +dotnet new -i Stylet.Templates +``` + +Then create a new .NET 5.0 project with: + +``` +dotnet new stylet -n MyStyletProject +``` + +(changing `MyStyletProject` as appropriate). + +If you want to create a .NET Core 3.1 project, then: + +``` +dotnet new stylet -F netcoreapp3.1 -n MyStyletProject +``` + +If you want to set up your project manually, install the [Stylet](https://www.nuget.org/packages/Stylet) package, then follow the instructions in the [Quick Start](https://github.com/canton7/Stylet/wiki/Quick-Start). + +Stylet requires .NET 5.0+ or .NET Core 3.0+. + + +### .NET Framework (<= .NET 4) For .NET Framework projects, the quickest way to get started is to create a new "WPF Application" project, then install the NuGet package [Stylet.Start](https://www.nuget.org/packages/Stylet.Start). This will install Stylet, and set up a simple skeleton project. @@ -32,28 +61,6 @@ If you want to set up your project manually, install the [Stylet](https://www.nu Stylet requires .NET 4.5 (Visual Studio 2012 or higher). -### .NET Core - -For .NET Core projects, the quickest way to get started is by using `dotnet new` with Stylet's template. - -Open a command window where you want to create your new project, and install the Stylet templates using: - -``` -dotnet new -i Stylet.Templates -``` - -Then create a new project with: - -``` -dotnet new stylet -o MyStyletProject -``` - -(changing `MyStyletProject` as appropriate). - -If you want to set up your project manually, install the [Stylet](https://www.nuget.org/packages/Stylet) package, then follow the instructions in the [Quick Start](https://github.com/canton7/Stylet/wiki/Quick-Start). - -Stylet requires .NET Core 3.0. - Documentation ------------- diff --git a/StyletTemplates/StyletTemplates.csproj b/StyletTemplates/StyletTemplates.csproj index b72e8ab..f7115fc 100644 --- a/StyletTemplates/StyletTemplates.csproj +++ b/StyletTemplates/StyletTemplates.csproj @@ -1,7 +1,7 @@ - + Template - netcoreapp3.1 + net5.0-windows true true diff --git a/StyletTemplates/templates/StyletApplication-CSharp/.template.config/template.json b/StyletTemplates/templates/StyletApplication-CSharp/.template.config/template.json index 5750583..9acb051 100644 --- a/StyletTemplates/templates/StyletApplication-CSharp/.template.config/template.json +++ b/StyletTemplates/templates/StyletApplication-CSharp/.template.config/template.json @@ -12,5 +12,43 @@ }, "sourceName": "Company.StyletApplication1", "preferNameDirectory": true, - "defaultName": "StyletApp1" + "defaultName": "StyletApp1", + "symbols": { + "Framework": { + "type": "parameter", + "description": "The target framework for the project", + "datatype": "choice", + "choices": [ + { + "choice": "net5.0-windows", + "description": "Target .NET 5.0" + }, + { + "choice": "netcoreapp3.1", + "description": "Target .NET Core 3.1" + } + ], + "replaces": "net5.0-windows", + "defaultValue": "net5.0-windows" + }, + "SDK": { + "type": "generated", + "generator": "switch", + "parameters": { + "evaluator": "C++", + "datatype": "string", + "cases": [ + { + "condition": "((Framework == 'netcoreapp3.0') || (Framework == 'netcoreapp3.1'))", + "value": "Microsoft.NET.Sdk.WindowsDesktop", + }, + { + "condition": "(true)", + "value": "Microsoft.NET.Sdk" + } + ] + }, + "replaces": "Microsoft.NET.Sdk" + } + } } diff --git a/StyletTemplates/templates/StyletApplication-CSharp/App.xaml b/StyletTemplates/templates/StyletApplication-CSharp/App.xaml index eff38f5..91401b0 100644 --- a/StyletTemplates/templates/StyletApplication-CSharp/App.xaml +++ b/StyletTemplates/templates/StyletApplication-CSharp/App.xaml @@ -2,7 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="https://github.com/canton7/Stylet" - xmlns:local="clr-namespace:Company.WpfApplication1"> + xmlns:local="clr-namespace:Company.StyletApplication1"> diff --git a/StyletTemplates/templates/StyletApplication-CSharp/Bootstrapper.cs b/StyletTemplates/templates/StyletApplication-CSharp/Bootstrapper.cs index 58c36d0..043db7d 100644 --- a/StyletTemplates/templates/StyletApplication-CSharp/Bootstrapper.cs +++ b/StyletTemplates/templates/StyletApplication-CSharp/Bootstrapper.cs @@ -1,4 +1,4 @@ -using Company.WpfApplication1.Pages; +using Company.StyletApplication1.Pages; using Stylet; using StyletIoC; diff --git a/StyletTemplates/templates/StyletApplication-CSharp/Company.StyletApplication1.csproj b/StyletTemplates/templates/StyletApplication-CSharp/Company.StyletApplication1.csproj index c26792d..b93cc34 100644 --- a/StyletTemplates/templates/StyletApplication-CSharp/Company.StyletApplication1.csproj +++ b/StyletTemplates/templates/StyletApplication-CSharp/Company.StyletApplication1.csproj @@ -1,14 +1,14 @@ - + WinExe - netcoreapp3.1 - Company.StyletApplication1 + net5.0-windows true + + Company.StyletApplication1 - \ No newline at end of file diff --git a/StyletTemplates/templates/StyletApplication-CSharp/Pages/ShellView.xaml b/StyletTemplates/templates/StyletApplication-CSharp/Pages/ShellView.xaml index b56edd6..f2b9c44 100644 --- a/StyletTemplates/templates/StyletApplication-CSharp/Pages/ShellView.xaml +++ b/StyletTemplates/templates/StyletApplication-CSharp/Pages/ShellView.xaml @@ -4,7 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="https://github.com/canton7/Stylet" - xmlns:local="clr-namespace:Company.WpfApplication1.Pages" + xmlns:local="clr-namespace:Company.StyletApplication1.Pages" mc:Ignorable="d" d:DataContext="{d:DesignInstance local:ShellViewModel}" Title="Stylet Project" Height="450" Width="800">