Aracılığıyla paylaş


RadialControllerConfiguration Class

Definition

Provides configuration details for the RadialController menu.

public ref class RadialControllerConfiguration sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RadialControllerConfiguration final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RadialControllerConfiguration
Public NotInheritable Class RadialControllerConfiguration
Inheritance
Object Platform::Object IInspectable RadialControllerConfiguration
Attributes

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)

Examples

In this example, we specify which built-in tools are displayed on the menu, and set the default tool.

  1. First, in the ModifySystemDefaults function, we get a reference to the RadialControllerConfiguration object for the Surface Dial (config) by calling GetForCurrentView.
  2. Then, we call SetDefaultMenuItems to specify the default collection of built-in menu items (Volume and Scroll).
  3. In the Select_Volume function, we attempt to set the default menu item to Volume by calling TrySelectDefaultMenuItem.
public sealed partial class MainPage : Page
{
  RadialControllerConfiguration config;

  private void ModifySystemDefaults(object sender, RoutedEventArgs e) 
  {
    config = RadialControllerConfiguration.GetForCurrentView();
    config.SetDefaultMenuItems(
      new[] { RadialControllerSystemMenuItemKind.Volume, 
        RadialControllerSystemMenuItemKind.Scroll });
  }

  private void Select_Volume(object sender, RoutedEventArgs e)
  {
    config = RadialControllerConfiguration.GetForCurrentView();
    config.TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind.Volume); 
  }
}

In this example, we clear all built-in tools by calling SetDefaultMenuItems and passing an empty collection.

Important

When present, the InkToolbar adds two custom tools to the RadialController menu (pen and stroke size). These tools are not accessible through RadialController APIs such as Items or SetDefaultMenuItems.

private void ClearSystemDefaults(object sender, RoutedEventArgs e) 
{
  config = RadialControllerConfiguration.GetForCurrentView();
  config.SetDefaultMenuItems(
    new[] { });
}

Remarks

Version history

Windows version SDK version Value added
1703 15063 ActiveControllerWhenMenuIsSuppressed
1703 15063 IsMenuSuppressed
1709 16299 AppController
1709 16299 IsAppControllerEnabled

Properties

ActiveControllerWhenMenuIsSuppressed

Gets or sets the RadialController to activate when the RadialController menu is suppressed.

AppController

Gets or sets whether the RadialController object is bound to the main application process rather than a specific app view (or top-level window).

If AppController is set, that radial controller (and menu) is used for the top-level window and all views in the application process (overriding any individual view controllers you have defined).

Note

You must also set IsAppControllerEnabled to true.

IsAppControllerEnabled

Gets or sets whether the RadialController object is enabled as an AppController and controller events can be handled by your app.

IsMenuSuppressed

Gets or sets whether the RadialController menu can be displayed.

Methods

GetForCurrentView()

Retrieves a RadialControllerConfiguration object bound to the active application.

ResetToDefaultMenuItems()

Restores the RadialController menu to the default configuration.

SetDefaultMenuItems(IIterable<RadialControllerSystemMenuItemKind>)

Specifies which built-in tools are shown on the RadialController menu.

Important

When present, the InkToolbar adds two custom tools to the RadialController menu (pen and stroke size). These tools are not accessible through RadialController APIs such as Items or SetDefaultMenuItems.

TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind)

Attempts to select and activate a tool from the collection of built-in RadialController tools supported for the current app context.

Applies to

See also