-
Notifications
You must be signed in to change notification settings - Fork 27
Getting Started
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:
-
ManagedShellprovides theShellConfigandShellManagerclasses, useful for managing the lifecycle of shell components. -
ManagedShell.AppBarprovides AppBar support for displaying toolbars at the edge of the screen. -
ManagedShell.Commonprovides helper classes useful for shell replacements, and other shared classes used amongst ManagedShell components. -
ManagedShell.Interopprovides P/Invoke methods. -
ManagedShell.UWPInteropprovides methods useful for fetching and displaying UWP/WinRT app packages. -
ManagedShell.WindowsTasksprovides the tasks service for taskbar-related functionality, such as tracking and managing open windows. -
ManagedShell.WindowsTrayprovides the tray services for notification area-related functionality.
- Add a reference to the ManagedShell package.
- Instantiate a new
ShellManagerobject:
using ManagedShell;
...
ShellManager _shellManager = new ShellManager();- 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.