Share via


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 功能表選取自訂工具時。

適用於

另請參閱