Skip to content

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 5 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Microsoft.Dotnet.Wpf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.DotNet.Arcade.Wpf
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Arcade.Wpf.Sdk.ArchNeutral", "packaging\Microsoft.DotNet.Arcade.Wpf.Sdk\Microsoft.DotNet.Arcade.Wpf.Sdk.ArchNeutral.csproj", "{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Wpf.ProjectTemplates.ArchNeutral", "packaging\Microsoft.Dotnet.Wpf.ProjectTemplates\Microsoft.DotNet.Wpf.ProjectTemplates.ArchNeutral.csproj", "{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -75,6 +77,18 @@ Global
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|x64.Build.0 = Release|x64
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|x86.ActiveCfg = Release|Any CPU
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3}.Release|x86.Build.0 = Release|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Debug|x64.ActiveCfg = Debug|x64
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Debug|x64.Build.0 = Debug|x64
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Debug|x86.ActiveCfg = Debug|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Debug|x86.Build.0 = Debug|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Release|Any CPU.Build.0 = Release|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Release|x64.ActiveCfg = Release|x64
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Release|x64.Build.0 = Release|x64
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Release|x86.ActiveCfg = Release|Any CPU
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -85,6 +99,7 @@ Global
{9A7E395B-E859-40E2-809D-EFB72CF3A2EE} = {BF20132A-191F-4D34-9A1B-831772A6DFCF}
{8A2ABE39-2D50-48CA-AC32-078BBA32757A} = {0159B0F1-0626-4BED-8D1B-CBFF4F12C369}
{B73BB4AB-68DE-4B91-BBB0-AB4F2D504AC3} = {8A2ABE39-2D50-48CA-AC32-078BBA32757A}
{BFF6C118-3369-43B5-ACA6-D65ED00EEBE0} = {0159B0F1-0626-4BED-8D1B-CBFF4F12C369}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D4D12991-F531-4FC3-849D-29946BCA818A}
Expand Down
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>
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": [
""
]
}
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
}
]
}
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>
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
{
}
}
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>
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>
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();
}
}
}