Skip to content

Niels9001/temp update - #6207

Merged
Niels Laute (niels9001) merged 14 commits into
user/muyuanli/dotnetnewtemplatefrom
niels9001/template-updates
Feb 25, 2026
Merged

Niels Laute (niels9001) merged 14 commits into
user/muyuanli/dotnetnewtemplatefrom
niels9001/template-updates

Conversation

@niels9001

Copy link
Copy Markdown
Contributor

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@niels9001
Niels Laute (niels9001) changed the base branch from main to user/muyuanli/dotnetnewtemplate February 11, 2026 15:17

@michael-hawker Michael Hawker (michael-hawker) left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some high-level comments/thoughts.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is an item template it shouldn't need a project file, eh?

@MuyuanMS

Copy link
Copy Markdown
Contributor

If the intention is to make new templates for dotnet new only for now, I would say place these templates under DotnetNewTemplates folder. VSIX/ItemTemplates and VSIX/ProjectTemplates are templates that can be converted to both DotnetNew templates and Visual Studio templates. If the intention is to make these changes both for dotnet new and vs templates, then current way is totally fine, but just need to make sure that it can be built to vsix extension as well.

@niels9001

Copy link
Copy Markdown
Contributor Author

If the intention is to make new templates for dotnet new only for now, I would say place these templates under DotnetNewTemplates folder. VSIX/ItemTemplates and VSIX/ProjectTemplates are templates that can be converted to both DotnetNew templates and Visual Studio templates. If the intention is to make these changes both for dotnet new and vs templates, then current way is totally fine, but just need to make sure that it can be built to vsix extension as well.

Yeah, ideally we'd want both. NavView and ContentDialog (the ones that are new) + the changes to existing templates should be available on both as a bare minimum. We can then iterate in the future with more advanced templates in dotnetnew first before bringing them to vsix!

Let me know if I need to update anything for this to be merged in :)!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the Windows App SDK Visual Studio extension by adding a new ContentDialog item template and a NavigationApp project template, along with modernizing existing templates with custom title bar support and app icons.

Changes:

  • Adds a new ContentDialog item template for creating custom dialog controls
  • Adds a comprehensive NavigationApp project template with navigation patterns and multiple pages
  • Updates existing BlankApp and SingleProjectPackagedApp templates to include custom title bar and app icon support

Reviewed changes

Copilot reviewed 31 out of 44 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
dev/VSIX/WindowsAppSDK.Extension.sln Added ContentDialog item template project reference
dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/* Updated MainWindow with custom title bar, added AppIcon.ico reference
dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/* Updated MainWindow with custom title bar, added AppIcon.ico file
dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/* New navigation app template with pages, navigation patterns, and modern UI
dev/VSIX/ItemTemplates/Neutral/CSharp/ContentDialog/* New ContentDialog item template files
dev/VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj Added ContentDialog template project reference
dev/VSIX/Extension/Cs/Dev17/Standalone/source.extension.vsixmanifest Added ContentDialog template asset
dev/VSIX/DotnetNewTemplates/WinAppSdk.CSharp.DotnetNewTemplates.csproj Added ContentDialog dotnet new template configuration

Comment on lines +59 to +68
switch (item.Tag)
{
case "home":
NavFrame.Navigate(typeof(HomePage));
break;
case "about":
NavFrame.Navigate(typeof(AboutPage));
break;
}
}

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing navigation fallback handling in the switch statement. When neither "home" nor "about" matches the Tag property, no action is taken. Consider adding a default case or logging to handle unexpected navigation items, improving maintainability and debugging.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot open a new pull request to apply changes based on [this feedback]. Throw a new exception. (#6207 (comment))

Comment on lines +107 to +120

<!-- Content dialog item template -->
<ItemGroup>
<None Include="templates\item-content-dialog\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="templates\item-content-dialog\ContentDialogItem.xaml"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/ContentDialogItem.xaml" />
<None Include="templates\item-content-dialog\ContentDialogItem.xaml.cs"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/ContentDialogItem.xaml.cs" />
<Compile Remove="templates\item-content-dialog\**" />
</ItemGroup>

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ContentDialog dotnet new template references files in "templates\item-content-dialog" directory, but this directory and its files (ContentDialogItem.xaml, ContentDialogItem.xaml.cs, and .template.config) are missing from this PR. The template configuration cannot work without these files being added to the repository.

Suggested change
<!-- Content dialog item template -->
<ItemGroup>
<None Include="templates\item-content-dialog\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="templates\item-content-dialog\ContentDialogItem.xaml"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/ContentDialogItem.xaml" />
<None Include="templates\item-content-dialog\ContentDialogItem.xaml.cs"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/ContentDialogItem.xaml.cs" />
<Compile Remove="templates\item-content-dialog\**" />
</ItemGroup>

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +63
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>$DotNetVersion$-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>$safeprojectname$</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<WinUISDKReferences>false</WinUISDKReferences>
<EnableMsixTooling>true</EnableMsixTooling>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\AppIcon.ico" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>

<ItemGroup>
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

<!--
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored.
-->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<ProjectCapability Include="Msix"/>
</ItemGroup>

<!-- This is a temporary workaround to test dotnet new template - it will block vstemplate from working -->
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="*" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="*" />
</ItemGroup>

<!--
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
Explorer "Package and Publish" context menu entry to be enabled for this project even if
the Windows App SDK Nuget package has not yet been restored.
-->
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>

<!-- Publish Properties -->
<PropertyGroup>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
</PropertyGroup>
</Project>

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NavigationApp project template is missing required files for Visual Studio integration:

  1. A .vstemplate file (e.g., WinUI.Desktop.Cs.NavigationApp.vstemplate) to define the template metadata and structure
  2. The template is not added to the WindowsAppSDK.Extension.sln solution file
  3. The template is not referenced in the VSIX extension project files

Without these, the template cannot be discovered or used in Visual Studio. Compare with dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/ which has all required files.

Copilot uses AI. Check for mistakes.
@MuyuanMS

Copy link
Copy Markdown
Contributor

If the intention is to make new templates for dotnet new only for now, I would say place these templates under DotnetNewTemplates folder. VSIX/ItemTemplates and VSIX/ProjectTemplates are templates that can be converted to both DotnetNew templates and Visual Studio templates. If the intention is to make these changes both for dotnet new and vs templates, then current way is totally fine, but just need to make sure that it can be built to vsix extension as well.

Yeah, ideally we'd want both. NavView and ContentDialog (the ones that are new) + the changes to existing templates should be available on both as a bare minimum. We can then iterate in the future with more advanced templates in dotnetnew first before bringing them to vsix!

Let me know if I need to update anything for this to be merged in :)!

Then I have no concerns! Just making sure that you are aware that new templates also need to work for vstemplate - I actually don't exactly know how to verify it , assumingly by building dev/VSIX/WindowsAppSDK.Extension.sln

Copilot AI commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Niels Laute (@niels9001) I've opened a new pull request, #6251, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Niels Laute (@niels9001) I've opened a new pull request, #6252, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Add default case throwing InvalidOperationException in navigation switch statement

Co-authored-by: niels9001 <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: niels9001 <[email protected]>
@niels9001
Niels Laute (niels9001) merged commit e1df480 into user/muyuanli/dotnetnewtemplate Feb 25, 2026
1 check passed
@niels9001
Niels Laute (niels9001) deleted the niels9001/template-updates branch February 25, 2026 09:36
Dinah Xiaoman G (DinahK-2SO) pushed a commit that referenced this pull request Apr 20, 2026
* Adding TitleBar and .ico

* Adding the ContentDialog ItemTemplate

* Adding NavigationView template

* Missed a csharp template and added

* Push

* Update WinAppSdk.CSharp.DotnetNewTemplates.csproj

* Clean up navview project

* Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml.cs

Co-authored-by: Copilot <[email protected]>

* Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml.cs

Co-authored-by: Copilot <[email protected]>

* Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml.cs

Co-authored-by: Copilot <[email protected]>

* Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml.cs

Co-authored-by: Copilot <[email protected]>

* Update dev/VSIX/ItemTemplates/Neutral/CSharp/ContentDialog/ContentDialog.xaml.cs

Co-authored-by: Copilot <[email protected]>

* Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml.cs

Co-authored-by: Copilot <[email protected]>

* Add default case with exception to navigation switch statement (#6252)

* Initial plan

* Add default case throwing InvalidOperationException in navigation switch statement

Co-authored-by: niels9001 <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: niels9001 <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: niels9001 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants