Skip to content

Files

Latest commit

c1be738 · May 17, 2023

History

History

docs

Dev Documentation

Fork, Clone, Branch and Create your PR

Once you've discussed your proposed feature/fix/etc. with a team member, and you've agreed on an approach or a spec has been written and approved, it's time to start development:

  1. Fork the repo if you haven't already
  2. Clone your fork locally
  3. Create & push a feature branch
  4. Work on your changes

Rules

  • Follow the pattern of what you already see in the code.
  • Coding style.
  • Try to package new ideas/components into libraries that have nicely defined interfaces.
  • Package new ideas into classes or refactor existing ideas into a class as you extend.
  • When adding new classes/methods/changing existing code: add new unit tests or update the existing tests.

Compiling Dev Home

Compiling Source Code

There are two ways to compile locally.

  • Open the Developer Command Prompt for Visual Studio
  • Run Build from Dev Home's root directory. You can pass in a list of platforms/configurations
  • The Dev Home MSIX will be in your repo under AppxPackages\x64\debug

Alternatively

  • Open DevHome.sln in Visual Studio, in the Solutions Configuration drop-down menu select Release or Debug, from the Build menu choose Build Solution.

How to create new Tools

  1. Create a new directory with your tool's name under tools with three subdirectories src, test, and uitest
  2. Create a new WinUI 3 Class Library project in your src directory
  3. Create the Strings\en-us directories under src. Add Resources.resw and include the following code:
    <data name="NavigationPane.Content" xml:space="preserve">
      <value>[Name of your tool that will appear in navigation menu]</value>
    </data>
  4. Add a project reference from DevHome to your project
  5. Add a project reference from your project to DevHome.Common project under common
  6. Create your XAML view and viewmodel. Your view class must inherit from ToolPage and implement requirements. Specifications for the Dev Home tools API.
  7. Update NavConfig.json with your tool. Specifications for the NavConfig.json schema.

Example:

public partial class SampleToolPage : ToolPage
{
    public override string ShortName => "SampleTool";
}

Implementation details

Dev Home framework

The Dev Home project contains the wrapping framework for the Dev Home application. It's responsible for:

  • Loading the individual Dev Home tools.
  • Definition of the interface used by Dev Home framework to manage the tools. All tools must implement this interface.

The common lib, as the name suggests, contains code shared by multiple tools and the Dev Home framework