SOLVED: SystemTray customization in WDE

Let’s talk about Window: SystemTrayView (ISystemTrayContextMenu)

In the documentation, there is a screenshot of a customized systemtray but nothing about how we add item on it

Do you have information to share?

Thank you

Try this:

            container.RegisterType<ICustomMenuView, CustomMenuView>();
            try
            {
                viewManager.ViewsByRegionName["SystemTrayFreeMenuItemsRegion"].Insert(0,
                    new ViewActivator()
                    {
                        ViewType = typeof(ICustomMenuView),
                        ViewName = "CustomMenuView",
                        ActivateView = true
                    });
            }
            catch(Exception e)
            {
                log.Error("Error SystemTrayMenuItem", e);
            }

Where CustomMenuView is like this:

<MenuItem x:Class="WDEScratchPad.CustomViews.CustomMenuView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			xmlns:localization="clr-namespace:Tomers.WPF.Localization;assembly=Tomers.WPF.Localization"
			xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"
			Header="Test Menu" Click="MenuItem_Click">

</MenuItem>

It is Working fine
Thank you