This repository provides a template for creating custom widgets for Xbox Game Bar. With this template, you can quickly get started with developing widgets to enhance the gaming experience for Xbox users.
This project was developed using Visual Studio 2022 Community edition. Ensure you have this IDE installed for seamless development experience.
To use this widget template, follow these steps:
- Create a new repo from this template in the top right of this repo.
- Clone or download your new repository to your local machine.
- Open the solution file (
WidgetTemplate.sln) in Visual Studio 2022. - Install the NuGet package listed in the Prerequisites section.
- You probably want to start out with editing Widget1.xaml file.
- Prerequisites:
- Visual Studio 2022 Community Edition (optional)
- Install the NuGet package Microsoft.Gaming.XboxGameBar for your project.
- Target a minimum of Windows 10 version 2004 (10.0 build 19041).
- Implement Xbox Game Bar API calls to interact with the Game Bar environment.
- Test your widget locally using Xbox Game Bar Developer Mode.
- Deploy your widget to the Microsoft Store for distribution.
Refer to the official Microsoft documentation for detailed instructions on developing and deploying Xbox Game Bar widgets.
These are the recommended files to rename the project (also look out for version number and author).
-
Rename Namespace:
- Right-click project > Rename > Enter new name.
-
Update Project Files:
Update all instances of the following using Find and Replace (Ctrl + Shift + H):
WidgetTemplate> Replace with new name, eg.MyWidget.Widget1> Replace with new name, eg.WidgetNameAND rename the file called "Widget1", eg.WidgetName.xaml.widget1> Replace with new name, eg.widgetName.
IMPORTANT: Check "Match case" when using find and replace.
-
Update Assembly Information:
- Rename the source folder (repo/WidgetTemplate) and solution file (WidgetTemplate.sln)
- Update line 7 in the solution file: eg.
Project("{CB0B05F0-5107-42F6-83B2-16BAA5DD2D9B}") = "WidgetName", "src\WidgetName.csproj", "{EC5E77E8-A523-4658-9D73-D35C831C4810}"
-
Debug/build the app to validate renaming
-
Push changes to remote
This template provides a basic structure for creating Xbox Game Bar widgets. Customize the provided code according to your widget's requirements, including layout, functionality, and interaction with the Game Bar environment.
This project is licensed under the GNU General Public License v3.0. Feel free to use, modify, and distribute the code as per the terms of the license.
Special thanks to the Xbox Game Bar development team at Microsoft for providing the tools and resources necessary for creating custom widgets. I've created this repo since the C# setup is not provided and Microsoft only refers to the samples.