RadialControllerMenuItem 类

定义

表示 RadialController 菜单中的单个自定义工具。

public ref class RadialControllerMenuItem sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RadialControllerMenuItem final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RadialControllerMenuItem
Public NotInheritable Class RadialControllerMenuItem
继承
Object Platform::Object IInspectable RadialControllerMenuItem
属性

Windows 要求

设备系列
Windows 10 Anniversary Edition (在 10.0.14393.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v3.0 中引入)

示例

在此示例中,我们将一个自定义工具 (Sample 带有标准图标的) 添加到 Surface Dial 菜单。

  1. 首先,通过调用 CreateForCurrentView 获取对 Surface Dial (myController) 的 RadialController 对象的引用。
  2. 然后,通过调用 RadialControllerMenuItem.CreateFromIcon 创建 RadialControllerMenuItem (myItem) 的实例。
  3. 最后,我们将该项追加到菜单项的集合中。
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;
     }
 }

注解

版本历史记录

Windows 版本 SDK 版本 已添加值
1703 15063 CreateFromFontGlyph (String,String,String)
1703 15063 CreateFromFontGlyph (String,String,String,Uri)

属性

DisplayText

获取 RadialController 菜单上自定义工具的文本字符串。

Tag

获取或设置用于标识 RadialController 菜单上的自定义工具的对象。

方法

CreateFromFontGlyph(String, String, String)

使用 “RadialController ”菜单上的指定文本字符串和字体字形) 创建自定义工具 (。

CreateFromFontGlyph(String, String, String, Uri)

使用 “RadialController ”菜单上的指定文本字符串和字体字形) 创建自定义工具 (。

CreateFromIcon(String, RandomAccessStreamReference)

在 (RadialController 菜单上使用指定的文本字符串和自定义图标) 创建自定义工具。

CreateFromKnownIcon(String, RadialControllerMenuKnownIcon)

使用“ RadialController ”菜单上的指定文本字符串和系统图标) 创建自定义工具 (。

事件

Invoked

RadialController 菜单中选择自定义工具时发生。

适用于

另请参阅