-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Project template for WPF #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8977457
Add WPF project template
vatsan-madhavan 3c1ea93
Workaround for GenerateVersionFileWithRepositoryCommit target to ensu…
vatsan-madhavan 2a3e8b9
Remove extra copy of SourceRevisionId from version.txt
vatsan-madhavan f320281
Merge branch 'master' into dev/vatsanm/projecttemplate
vatsan-madhavan f3780b6
Merge branch 'master' into dev/vatsanm/projecttemplate
vatsan-madhavan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...soft.Dotnet.Wpf.ProjectTemplates/Microsoft.DotNet.Wpf.ProjectTemplates.ArchNeutral.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<ProjectGuid>{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}</ProjectGuid> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
<Platforms>AnyCPU;x64</Platforms> | ||
<IsShippingPackage>true</IsShippingPackage> | ||
<VersionPrefix>3.0.0</VersionPrefix> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<!-- | ||
PlatformIndependentPackage = true means that this package does | ||
not require the automatic generation of a runtime.json file using | ||
the Bait & Switch technique to reference RID specific packages | ||
--> | ||
<PlatformIndependentPackage>true</PlatformIndependentPackage> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<PackageName>$(MSBuildProjectName.Replace('.ArchNeutral',''))</PackageName> | ||
<AssemblyName>$(PackageName)</AssemblyName> | ||
<PackageDescription>Project templates for .NET Core WPF Projects</PackageDescription> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackagingContent Include="useSharedDesignerContext.txt" SubFolder="root" /> | ||
<PackagingContent Include="content\**\*" SubFolder="root\%(RecursiveDir)" /> | ||
</ItemGroup> | ||
</Project> |
24 changes: 24 additions & 0 deletions
24
...t.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/dotnetcli.host.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/dotnetcli.host", | ||
"symbolInfo": { | ||
"TargetFrameworkOverride": { | ||
"isHidden": "true", | ||
"longName": "target-framework-override", | ||
"shortName": "" | ||
}, | ||
"Framework": { | ||
"longName": "framework" | ||
}, | ||
"skipRestore": { | ||
"longName": "no-restore", | ||
"shortName": "" | ||
}, | ||
"langVersion": { | ||
"longName": "langVersion", | ||
"shortName": "" | ||
} | ||
}, | ||
"usageExamples": [ | ||
"" | ||
] | ||
} |
86 changes: 86 additions & 0 deletions
86
....Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/template.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "Microsoft", | ||
"classifications": ["Common", "WPF"], | ||
"name": "WPF Application", | ||
"generatorVersions": "[1.0.0.0-*)", | ||
"description": "A project for creating a .NET Core WPF Application", | ||
"groupIdentity": "Microsoft.Common.WPF", | ||
"precedence": "3000", | ||
"identity": "Microsoft.Common.WPF", | ||
"shortName": "wpf", | ||
"tags": { | ||
"language": "C#", | ||
"type": "project" | ||
}, | ||
"sourceName": "Company.WpfApplication1", | ||
"preferNameDirectory": true, | ||
"symbols": { | ||
"TargetFrameworkOverride": { | ||
"type": "parameter", | ||
"description": "Overrides the target framework", | ||
"replaces": "TargetFrameworkOverride", | ||
"datatype": "string", | ||
"defaultValue": "" | ||
}, | ||
"Framework": { | ||
"type": "parameter", | ||
"description": "The target framework for the project.", | ||
"datatype": "choice", | ||
"choices": [ | ||
{ | ||
"choice": "netcoreapp3.0", | ||
"description": "Target netcoreapp3.0" | ||
} | ||
], | ||
"replaces": "netcoreapp3.0", | ||
"defaultValue": "netcoreapp3.0" | ||
}, | ||
"langVersion": { | ||
"type": "parameter", | ||
"datatype": "text", | ||
"description": "Sets langVersion in the created project file", | ||
"defaultValue": "", | ||
"replaces": "$(ProjectLanguageVersion)" | ||
}, | ||
"HostIdentifier": { | ||
"type": "bind", | ||
"binding": "HostIdentifier" | ||
}, | ||
"skipRestore": { | ||
"type": "parameter", | ||
"datatype": "bool", | ||
"description": "If specified, skips the automatic restore of the project on create.", | ||
"defaultValue": "false" | ||
} | ||
}, | ||
"primaryOutputs": [ | ||
{ "path": "Company.WpfApplication1.csproj" }, | ||
{ | ||
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", | ||
"path": "MainWindow.xaml.cs" | ||
} | ||
], | ||
"defaultName": "WpfApp1", | ||
"postActions": [ | ||
{ | ||
"condition": "(!skipRestore)", | ||
"description": "Restore NuGet packages required by this project.", | ||
"manualInstructions": [ | ||
{ "text": "Run 'dotnet restore'" } | ||
], | ||
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025", | ||
"continueOnError": true | ||
}, | ||
{ | ||
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", | ||
"description": "Opens MainWindow.xaml.cs in the editor", | ||
"manualInstructions": [ ], | ||
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", | ||
"args": { | ||
"files": "1" | ||
}, | ||
"continueOnError": true | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/App.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Application x:Class="Company.WpfApplication1.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:Company.WpfApplication1" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
17 changes: 17 additions & 0 deletions
17
packaging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/App.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace Company.WpfApplication1 | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
....Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/Company.WpfApplication1.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">netcoreapp3.0</TargetFramework> | ||
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework> | ||
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.WpfApplication1</RootNamespace> | ||
<LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion> | ||
<UseWPF>true</UseWPF> | ||
</PropertyGroup> | ||
|
||
</Project> |
18 changes: 18 additions & 0 deletions
18
...aging/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/MainWindow.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Window x:Class="Company.WpfApplication1.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:Company.WpfApplication1" | ||
mc:Ignorable="d" | ||
Title="MainWindow" Height="450" Width="800"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="9*"/> | ||
<RowDefinition Height="1*"/> | ||
</Grid.RowDefinitions> | ||
<Label Content="Hello .NET Core!" HorizontalAlignment="Center" VerticalAlignment="Center" | ||
FontSize="40"/> | ||
<Button Content="Exit" Grid.Row="1" FontSize="20" Click="ButtonExit_Click"/> | ||
</Grid> | ||
</Window> |
33 changes: 33 additions & 0 deletions
33
...ng/Microsoft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/MainWindow.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 Company.WpfApplication1 | ||
{ | ||
/// <summary> | ||
/// Interaction logic for MainWindow.xaml | ||
/// </summary> | ||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void ButtonExit_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Application.Current.Shutdown(); | ||
} | ||
} | ||
} |
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.