Skip to content

Getting Started

Sam Johnson edited this page Jun 1, 2025 · 3 revisions

ManagedShell is available on the NuGet Gallery, multi-targeted to .NET 6, .NET Core 3.1, and .NET Framework 4.7.1.

ManagedShell consists of several different namespaces, each delivering specific shell functionality:

  • ManagedShell provides the ShellConfig and ShellManager classes, useful for managing the lifecycle of shell components.
  • ManagedShell.AppBar provides AppBar support for displaying toolbars at the edge of the screen.
  • ManagedShell.Common provides helper classes useful for shell replacements, and other shared classes used amongst ManagedShell components.
  • ManagedShell.Interop provides P/Invoke methods.
  • ManagedShell.UWPInterop provides methods useful for fetching and displaying UWP/WinRT app packages.
  • ManagedShell.WindowsTasks provides the tasks service for taskbar-related functionality, such as tracking and managing open windows.
  • ManagedShell.WindowsTray provides the tray services for notification area-related functionality.

Quick Start

  1. Add a reference to the ManagedShell package.
  2. Instantiate a new ShellManager object:
using ManagedShell;

...

ShellManager _shellManager = new ShellManager();
  1. When the user chooses to exit the application, notify AppBars that they are now allowed to close, and cleanly dispose of shell services:
// Notify AppBars that they are now allowed to close.
_shellManager.AppBarManager.SignalGracefulShutdown();

// Cleanly shut down and dispose of shell services.
_shellManager.Dispose();

// Exit the application.
Application.Current.Shutdown();

To use the tasks service to view open windows, reference the Tasks.GroupedWindows collection view:

MyTaskbarItemsControl.ItemsSource = _shellManager.Tasks.GroupedWindows;

For more information, see Tasks Service.


To use the tray service to view notification area icons, reference the NotificationArea.PinnedIcons and NotificationArea.UnpinnedIcons collections.

MyTrayPinnedItemsControl.ItemsSource = _shellManager.NotificationArea.PinnedIcons;
MyTrayUnpinnedItemsControl.ItemsSource = _shellManager.NotificationArea.UnpinnedIcons;

By default, the PinnedIcons collection contains Action Center, Power, Network, and Volume icons, but these can be customized.

For more information, see Tray Service.


To create an AppBar WPF window, create a window of the AppBarWindow class.

For more information, see AppBar.

Clone this wiki locally