Repository navigation
Niels9001/temp update - #6207
Niels Laute (niels9001) merged 14 commits into
Conversation
There was a problem hiding this comment.
Since this is an item template it shouldn't need a project file, eh?
|
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 :)! |
There was a problem hiding this comment.
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 |
| switch (item.Tag) | ||
| { | ||
| case "home": | ||
| NavFrame.Navigate(typeof(HomePage)); | ||
| break; | ||
| case "about": | ||
| NavFrame.Navigate(typeof(AboutPage)); | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Copilot open a new pull request to apply changes based on [this feedback]. Throw a new exception. (#6207 (comment))
|
|
||
| <!-- 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> |
There was a problem hiding this comment.
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.
| <!-- 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> |
| <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> |
There was a problem hiding this comment.
The NavigationApp project template is missing required files for Visual Studio integration:
- A .vstemplate file (e.g., WinUI.Desktop.Cs.NavigationApp.vstemplate) to define the template metadata and structure
- The template is not added to the WindowsAppSDK.Extension.sln solution file
- 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.
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 |
…omePage.xaml.cs Co-authored-by: Copilot <[email protected]>
…boutPage.xaml.cs Co-authored-by: Copilot <[email protected]>
…ettingsPage.xaml.cs Co-authored-by: Copilot <[email protected]>
…l.cs Co-authored-by: Copilot <[email protected]>
…log.xaml.cs Co-authored-by: Copilot <[email protected]>
|
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. |
…dow.xaml.cs Co-authored-by: Copilot <[email protected]>
|
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]>
e1df480
into
user/muyuanli/dotnetnewtemplate
* 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]>
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.