WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

WinAppSdk app templates should generate code following coding best practices

Open ChrisGuzak opened this issue 4 years ago • 2 comments

Describe the bug

@angelazhangmsft updated the templates for the WinAppSDK samples in this PR. These types of changes should be made to the templates that generate the WinAppSdk Apps.

Steps to reproduce the bug

  1. in VS create a new WinAppSdk C++ app using the templates
  2. inspect the code

Expected behavior

expected: the code follows best practices, for example using

namespace winrt
{
    using namespace Microsoft::UI::Xaml;
}

instead of

using namespace winrt;
using namespace Microsoft::UI::Xaml;

Screenshots

No response

NuGet package version

No response

Packaging type

No response

Windows version

No response

IDE

No response

Additional context

No response

ChrisGuzak avatar Nov 18 '21 19:11 ChrisGuzak

I think using the winrt namespace is fine as long as the project only uses C++/WinRT and doesn't use C++/CX and/or WRL along with it.

jaigak avatar Nov 22 '21 12:11 jaigak

This is the recommended best practice that we want templates to follow.

ChrisGuzak avatar Nov 30 '21 20:11 ChrisGuzak

@ChrisGuzak are there any remaining issues in the templates located in https://github.com/microsoft/WindowsAppSDK/tree/main/dev/VSIX?

bpulliam avatar Apr 21 '23 13:04 bpulliam