Aracılığıyla paylaş


RadialControllerMenu Class

Definition

Represents the integrated menu of contextual tools associated with the RadialController object.

Note

Tools added to a RadialController menu in support of a specific app context are only displayed in that context. They are not displayed for other RadialController instances.

public ref class RadialControllerMenu sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RadialControllerMenu final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RadialControllerMenu
Public NotInheritable Class RadialControllerMenu
Inheritance
Object Platform::Object IInspectable RadialControllerMenu
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 add a custom tool (Sample) with a standard icon to the Surface Dial menu.

  1. First, we get a reference to the RadialController object for the Surface Dial (myController) by calling CreateForCurrentView.
  2. We then create an instance of a RadialControllerMenuItem (myItem) by calling RadialControllerMenuItem.CreateFromIcon.
  3. Finally, we append that item to the collection of menu items.
public sealed partial class MainPage : Page
 {
     RadialController myController;

     public MainPage()
     {
         this.InitializeComponent();
         // Create a reference to the RadialController.
         myController = RadialController.CreateForCurrentView();

         // Create an icon for the custom tool.
         RandomAccessStreamReference icon =
           RandomAccessStreamReference.CreateFromUri(
             new Uri("ms-appx:///Assets/StoreLogo.png"));

         // Create a menu item for the custom tool.
         RadialControllerMenuItem myItem =
           RadialControllerMenuItem.CreateFromIcon("Sample", icon);

         // Add the custom tool to the RadialController menu.
         myController.Menu.Items.Add(myItem);

         // Declare input handlers for the RadialController.
         myController.ButtonClicked += MyController_ButtonClicked;
         myController.RotationChanged += MyController_RotationChanged;
     }
 }

Properties

IsEnabled

Gets or sets whether custom tools are displayed on the RadialController menu.

Items

Gets the collection of custom tools on the RadialController menu. Built-in tools are not included.

Methods

GetSelectedMenuItem()

Retrieves the active custom tool from the RadialController menu .

SelectMenuItem(RadialControllerMenuItem)

Selects and activates the specified custom tool from the RadialController menu.

TrySelectPreviouslySelectedMenuItem()

Attempts to select and activate the previously selected tool from the RadialController menu.

This method does not differentiate between built-in and custom tools.

Applies to

See also