#Windows10 – Customizing the default menu items in #SurfaceDial


I continue with the series of posts on work with Surface Dial. In the previous post I described how to create a menu with 3 options that are activated in the Surface Dial.

If our App needs several menus, one of the options that we may need to take into account is to disable the options that the Surface Dial defaults to. If we do not need vertical scrolling, or do not need Undo / Redo actions, it may be convenient to remove them from the radial menu.

The following image shows the default menu that is shown in the map view of the example with which we are working. In the same we can see the default options and that the 6th element is a custom menu.


Using RadialControllerConfiguration we can control the menu items. The following image shows a menu with only the elements of our App.


We can do this with the following code.

var controller = RadialController.CreateForCurrentView();
controller.RotationResolutionInDegrees = 0.2;
controller.UseAutomaticHapticFeedback = false;
var mapZoomItem = RadialControllerMenuItem.CreateFromFontGlyph("El Bruno – Maps Zoom", "\xE128", "Segoe MDL2 Assets");
var mapRotationItem = RadialControllerMenuItem.CreateFromFontGlyph("El Bruno – Map Rotation", "\xE128", "Segoe MDL2 Assets");
var disableDialItem = RadialControllerMenuItem.CreateFromFontGlyph("El Bruno – Disable Dial", "\xE128", "Segoe MDL2 Assets");
var surfaceDialConfiguration = RadialControllerConfiguration.GetForCurrentView();
surfaceDialConfiguration.SetDefaultMenuItems(new List<RadialControllerSystemMenuItemKind>{});
// Add 2 default system buttons
//surfaceDialConfiguration.SetDefaultMenuItems(new[] {
// RadialControllerSystemMenuItemKind.Volume,
// RadialControllerSystemMenuItemKind.NextPreviousTrack

And if we change the commented lines (15 to 19) we can leave in our menu 2 system options [Volume] and [Next Previous Track]; and the App menu items we add by code.


Source Code GitHub

Happy Coding !!!

Saludos @ Toronto

El Bruno



Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: