Git Product home page Git Product logo

microsoft / templatestudio Goto Github PK

View Code? Open in Web Editor NEW
2.6K 177.0 458.0 465.86 MB

Template Studio accelerates the creation of new WinUI 3, WPF, and UWP apps using a wizard-based experience.

License: Other

PowerShell 0.17% C# 30.96% Batchfile 0.04% HTML 0.02% Rich Text Format 64.09% Visual Basic .NET 4.69% C++ 0.03% C 0.01%
csharp uwp uwp-apps visual-studio windows-10 xaml template-engine template

templatestudio's Introduction

Template Studio

Template Studio is a suite of Visual Studio 2022 extensions that accelerate the creation of new WinUI 3, WPF, and UWP apps using a wizard-based experience.

Projects created with these extensions contain well-formed, readable code and incorporate the latest development features while implementing proven patterns and leading practices. The generated code includes links to documentation and TODO comments that provide useful insight and guidance for turning the generated projects into production applications.

To get started, install the appropriate extension, then select the corresponding Template Studio project template when creating a new project in Visual Studio. Name your project, then click Create to launch the Template Studio wizard.

See the roadmap to understand project priorities and upcoming milestones.

VS New Project Dialog

VS New Project screenshot

Template Studio for WinUI (C#)

Template Studio for WinUI screenshot

Template Studio for WPF

Template Studio for WPF screenshot

Template Studio for UWP

Template Studio for UWP screenshot

Build Status

CI Nightly
WinUI (C#) Build Status Build Status
WinUI (C++) Build Status Build Status
WPF Build Status Build Status
UWP Build Status Build Status
Shared Build Status Build Status
  • CI: Runs for all PRs and integrations and performs basic validation. Executes all tests in the Minimum* Groups.
  • Nightly: Runs on a nightly schedule and generates and builds all combinations of project templates in addition to performing more exhaustive tests than CI. Executes all tests in the Build* Groups.

Features

Template Studio approaches app creation using the following six attribute sets:

Project type

First, how do you want your app's UI navigation to behave?

App design pattern

Next, what coding pattern do you want to use in your project.

App pages

To accelerate app creation, we provide a number of app page templates you can use to add common UI pages into your new app. We currently include everything from a blank page, to common layouts (e.g., list/detail, web view), to pages that implement common patterns (e.g., app settings). Use the wizard to add as many of each page as you need, providing a name for each one, and we'll generate them for you.

Features

Specify which capabilities you want to use in your app, and we'll build out the framework for the features into your app, tagging TODO items. Here you can add features that enable your app to interact with storage, notifications, layout theming, etc.

Services

Connect to data services, setup cloud connected services for your application, and enforce rules with the XAML Styler extension.

Automated Tests

Lastly, you can include test projects for your application to run unit tests or use Selenium-like UI test automation.

After selecting the items wanted in your app, you can extend the generated code on UWP, WPF or WinUI 3.

Documentation

Principles

  1. Generated templates will be kept simple.
  2. Generated templates are a starting point, not a completed application.
  3. Generated templates must be able to compile and run once generated.
  4. Generated templates should work on all device families.
  5. Templates should have comments to aid developers. This includes links to signup pages for keys, MSDN, blogs and how-to's. All guidance provide should be validated from either the framework/SDK/library’s creator.
  6. All UWP features will be supported for two most recent RTM Windows 10 Updates. Those supported releases are Windows 10 May 2020 Update (version 2004) and Windows 10 May 2019 Update (version 1903).
  7. Templates released in production will try to adhere to the design language used in the current release of Windows 10.
  8. Code should follow .NET Core coding style.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

Contributing

See CONTRIBUTING.md.

Privacy Statement

The extension logs basic telemetry regarding what is selected in the wizard. Our Telemetry Data page has the trends from the telemetry. Please read the Microsoft privacy statement for more information.

.NET Foundation

This project is supported by the .NET Foundation.

Projects we like and collaborate with

Frameworks and libraries in generated code not created by our team

Frameworks

Libraries

templatestudio's People

Contributors

bartlannoeye avatar cliff-simpkins avatar crutkas avatar dependabot[bot] avatar dgomezc avatar geertvanhorrik avatar jamesmcroft avatar javitosanchez avatar jermws avatar leeparrishmsft avatar lucastaimsft avatar mbcrump avatar microsoft-github-policy-service[bot] avatar mikebattista avatar milazzom avatar mrlacey avatar mvegaca avatar myokeeh avatar mysterious-dev avatar nigel-sampson avatar pratikone avatar prupipho avatar ralarcon avatar scottkuhl avatar sibille avatar smorin4 avatar varorbc avatar vmadurga avatar vssilin avatar wasteam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

templatestudio's Issues

Store push notifications

Store push notifications are planned to be added but we need to resolve a positive experience for the end user. Right now the install experience leaves a bit to be desired.

Collection initialization notification in BackgroundTaskServices.cs

    private static IEnumerable<BackgroundTaskBase> CreateInstances()
    {
        var backgroundTasks = new List<BackgroundTaskBase>();
        
        backgroundTasks.Add(new BackgroundTask()); 

        return backgroundTasks;
    }

can be

    private static IEnumerable<BackgroundTaskBase> CreateInstances()
    {
        var backgroundTasks = new List<BackgroundTaskBase>
        {
            new BackgroundTask()
        };
        return backgroundTasks;
    }

Crashing after selecting project type

Wizard: v1.0.313.1
Template: v0.0.0313.9

System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.Combine(String[] paths)
at Microsoft.Templates.Core.TemplatesRepository.GetFrameworkTypeInfo(String fxType)
at Microsoft.Templates.Wizard.Steps.Framework.ViewModel.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Templates.Wizard.Steps.StepViewModel.<b__9_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at System.Windows.Window.ShowDialog()
at Microsoft.Internal.VisualStudio.PlatformUI.WindowHelper.ShowModal(Window window, IntPtr parent)
at Microsoft.Templates.Wizard.VisualStudio.VsGenShell.ShowModal(Window dialog)
at Microsoft.Templates.Wizard.GenController.GetUserSelection(WizardSteps selectionSteps)

classes are lacking identifiers

namespace App17.Activation
{
class ActivationService

I feel like this should be

namespace App17.Activation
{
private class ActivationService

Setting page location in SplitView

If they are using the SplitView template and select the Settings page, then it should be added to the bottom of the pane. You can see this in the News UWP app.

SettingStorage feels not done

Looking at the Suspend and Resume service, it directly references AppData. I thought we had discussed for SettingStorage to abstract the ApplicationData.Current folders.

Right click: Add Page

Contextual action over an active project in the solution explorer to launch the wizard and add a page to the project.

Pre-release vsix does load available templates properly

#Verified that the content is downloaded properly from the CND to %ProgramData%\UWPTemplates.

The templates discovery is not working properly. The mounting point in C:\users<user>.templateengine\settings.json is ok:

{
  "MountPoints": [
    {
      "ParentMountPointId": "00000000-0000-0000-0000-000000000000",
      "MountPointFactoryId": "94e92610-cf4c-4f6d-aeb6-9e42dde1899d",
      "MountPointId": "02486ad3-79e9-40c2-9332-6df301943e25",
      "Place": "C:\\ProgramData\\UWPTemplates\\Packages\\packages.nupkg"
    },
    {
      "ParentMountPointId": "00000000-0000-0000-0000-000000000000",
      "MountPointFactoryId": "8c19221b-dea3-4250-86fe-2d4e189a11d2",
      "MountPointId": "1027b9dc-f2c2-401d-ae6c-fcfa24638c85",
      **"Place": "C:\\ProgramData\\UWPTemplates\\Templates"**
    }
  ],
  "ComponentGuidToAssemblyQualifiedName": {},
  "ProbingPaths": [
    "C:\\Users\\<user>\\.templateengine\\UWPTemplates\\1.0.0\\content"
  ],
  "ComponentTypeToGuidList": {}
}

But there is nothing loaded in the cache files (templatecache.json):

{
  "TemplateInfo": []
}

The code running locally make the discovery properly and, after having the cache loaded the firts time, the extension running within Visua Studio shows the available templates fine.

Localization added into wizard

The system currently is localized. However, the wizard needs an improved experience for adding new languages. Due to the v0.1 experience, we're moving this out to focus on polishing the experience.

x:Bind & MVVMLight

We have started implementing binding with {x:Bind} instead of {Binding} and we have found an issue. MVVMLight is based on establishing the page DataContext in xaml thru a ViewModel property in a static ViewModelLocator type. The thing is, x:bind doesn't work with the concept of DataContext, but with concept of properties in page code behind. The solution proposed here is to cast back the DataContext to the ViewModel and use it in xaml, using the DataContext as a bridge. We found that very strange, and we don't see the need to use the ViewModelLocator strategy (see post comments).

In my opinion we have different options:

  1. Continuing using {Binding}
  2. Use {x:Bind} only for MVVM (basic). This will make much more complex the xaml sharing strategy
  3. Use {x:Bind} for both but with the casting strategy described above.

Theme change not being reflected

I created a nav pane & MVVM Light with just a settings page.

I nav to the setting page
Switch to dark theme
nav to main page
nav back to setting page
switch to light theme

Expected result: Go to light theme
Actual result: no theme change happens

Code Behind Framework shouldn't use bindings

We understand that, in general, the properties for the controls will be established / modified within event handlers. This means that, by default the basic framework will not use "Bindings" and will not have implementation of INotifyPropertyChange. Is that assumtion correct?

Pages: Settings

This page will have a section for About, licenses, and a privacy statement.

"Pages" and "Views" naming

We handle the concept of pages (in the wizard, in the templates and so on). For a certain page, the view part (xaml file) need to be called "xxxxView.xaml", for example, the "Blank Page" selected from the wizard will generate the following files:

Model/
• Blank1Model.cs
ViewModel/
• Blank1ViewModel.cs
View/
• Blank1View.xaml

That is, the "Blank Page" template will generate the Blank1View.xml

We want to double check that it is fine to have the templates called "Page" generating "Views".

Then, for the Code Behind framework, the xaml file will be named "xxxView.xaml" in order to be able to "reuse" as much xaml code as possible. Is that fine as well?

blog documentation should be replaced with only officials docs

ToastNotificationService.cs and probably others

        //TODO UWPTemplates: Handle activation from toast notification,
        //for more info handling activation see
        //https://blogs.msdn.microsoft.com/tiles_and_toasts/2015/07/08/quickstart-sending-a-local-toast-notification-and-handling-activations-from-it-windows-10/

Structure of MVVM project

We should have the following structure for an MVVM project :

This is the “structure” that we’ve been using:

Model/
• CarModel.cs
• DriverModel.cs
ViewModel/
• CarViewModel.cs
• DriverViewModel.cs
View/
• CarView.xaml
• DriverView.xaml

Navigation Service

MVVM Light still have the lack of some methods to be able to implement the navigation for UWP Apps. We have implemented our own NavigationService for the MVVM Basic Framework. We want to double check that it fine to use the Basic NavigationService with the MVVM Light framework.

By the way, it can be used wiht the CodeBehind framework, do you think it is worthy.

Finally, we can create a Mandatory dev feature for all the frameworks which use the NavigationService. Is it fine?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.