RadialControllerMenuItem
RadialControllerMenuItem
RadialControllerMenuItem
RadialControllerMenuItem
Class
Definition
Represents a single custom tool from the RadialController menu.
public : sealed class RadialControllerMenuItem : IRadialControllerMenuItempublic sealed class RadialControllerMenuItem : IRadialControllerMenuItemPublic NotInheritable Class RadialControllerMenuItem Implements IRadialControllerMenuItem// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
Examples
In this example, we add a custom tool (Sample) with a standard icon to the Surface Dial menu.
- First, we get a reference to the RadialController object for the Surface Dial (
myController) by calling CreateForCurrentView. - We then create an instance of a RadialControllerMenuItem (
myItem) by calling RadialControllerMenuItem.CreateFromIcon. - 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
DisplayText DisplayText DisplayText DisplayText
Gets the text string of the custom tool on the RadialController menu.
public : PlatForm::String DisplayText { get; }public string DisplayText { get; }Public ReadOnly Property DisplayText As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The text string of the custom tool.
- See Also
Tag Tag Tag Tag
Gets or sets an object used to identify custom tools on the RadialController menu.
public : PlatForm::Object Tag { get; set; }public object Tag { get; set; }Public ReadWrite Property Tag As object// You can use this property in JavaScript.
- Value
- PlatForm::Object object object object
Identifies custom tools on the RadialController menu.
- See Also
Methods
CreateFromFontGlyph(String, String, String) CreateFromFontGlyph(String, String, String) CreateFromFontGlyph(String, String, String) CreateFromFontGlyph(String, String, String)
Creates a custom tool (using the specified text string and font glyph) on the RadialController menu.
public : static RadialControllerMenuItem CreateFromFontGlyph(PlatForm::String displayText, PlatForm::String glyph, PlatForm::String fontFamily)public static RadialControllerMenuItem CreateFromFontGlyph(String displayText, String glyph, String fontFamily)Public Static Function CreateFromFontGlyph(displayText As String, glyph As String, fontFamily As String) As RadialControllerMenuItem// You can use this method in JavaScript.
- displayText
- PlatForm::String String String String
The text string to display for the custom tool.
- glyph
- PlatForm::String String String String
The font glyph to display for the custom tool.
- fontFamily
- PlatForm::String String String String
The font family that contains the glyph to display for the custom tool.
The custom tool.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
Use this method overload when you referencing a font already installed on the system. Otherwise, use CreateFromFontGlyph(String displayText, String glyph, String fontFamily, Uri fontUri).
RadialController menu operations, including CreateFromKnownIcon, CreateFromIcon, CreateFromFontGlyph, CreateFromFontGlyph, ResetToDefaultMenuItems, SetDefaultMenuItems, and TrySelectDefaultMenuItem, should be performed on the UI thread. Doing so in a background worker thread can cause issues with event handlers on the UI thread.
UX guidelines for the Surface Dial recommend the following:
- Text
- Names should be short to fit inside the central circle of the wheel menu
- Names should clearly identify the primary action (a complementary action can be implied)
- Scroll indicates the effect of both rotation directions
- Undo specifies a primary action, but redo (the complementary action) can be inferred and easily discovered by the user
CreateFromFontGlyph(String, String, String, Uri) CreateFromFontGlyph(String, String, String, Uri) CreateFromFontGlyph(String, String, String, Uri) CreateFromFontGlyph(String, String, String, Uri)
Creates a custom tool (using the specified text string and font glyph) on the RadialController menu.
public : static RadialControllerMenuItem CreateFromFontGlyph(PlatForm::String displayText, PlatForm::String glyph, PlatForm::String fontFamily, Uri fontUri)public static RadialControllerMenuItem CreateFromFontGlyph(String displayText, String glyph, String fontFamily, Uri fontUri)Public Static Function CreateFromFontGlyph(displayText As String, glyph As String, fontFamily As String, fontUri As Uri) As RadialControllerMenuItem// You can use this method in JavaScript.
- displayText
- PlatForm::String String String String
The text string to display for the custom tool.
- glyph
- PlatForm::String String String String
The font glyph to display for the custom tool.
- fontFamily
- PlatForm::String String String String
The font family that contains the glyph to display for the custom tool.
- fontUri
- Uri Uri Uri Uri
The Uniform Resource Identifier (URI) that identifies the location of the font used for rendering the glyph.
The custom tool.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
When using this method overload to reference a font glyph installed with your app's appx package, your app might display a broken image when deployed from Visual Studio. In this case, you should first create an app package (Project->Store->CreateAppPackage) and then deploy.
RadialController menu operations, including CreateFromKnownIcon, CreateFromIcon, CreateFromFontGlyph, CreateFromFontGlyph, ResetToDefaultMenuItems, SetDefaultMenuItems, and TrySelectDefaultMenuItem, should be performed on the UI thread. Doing so in a background worker thread can cause issues with event handlers on the UI thread.
UX guidelines for the Surface Dial recommend the following:
- Text
- Names should be short to fit inside the central circle of the wheel menu
- Names should clearly identify the primary action (a complementary action can be implied)
- Scroll indicates the effect of both rotation directions
- Undo specifies a primary action, but redo (the complementary action) can be inferred and easily discovered by the user
CreateFromIcon(String, RandomAccessStreamReference) CreateFromIcon(String, RandomAccessStreamReference) CreateFromIcon(String, RandomAccessStreamReference) CreateFromIcon(String, RandomAccessStreamReference)
Creates a custom tool (using the specified text string and custom icon) on the RadialController menu.
public : static RadialControllerMenuItem CreateFromIcon(PlatForm::String displayText, RandomAccessStreamReference icon)public static RadialControllerMenuItem CreateFromIcon(String displayText, RandomAccessStreamReference icon)Public Static Function CreateFromIcon(displayText As String, icon As RandomAccessStreamReference) As RadialControllerMenuItem// You can use this method in JavaScript.
- displayText
- PlatForm::String String String String
The text string to display for the custom tool.
- icon
- RandomAccessStreamReference RandomAccessStreamReference RandomAccessStreamReference RandomAccessStreamReference
The custom icon to display for the custom tool.
The custom tool.
Remarks
RadialController menu operations, including CreateFromKnownIcon, CreateFromIcon, CreateFromFontGlyph, CreateFromFontGlyph, ResetToDefaultMenuItems, SetDefaultMenuItems, and TrySelectDefaultMenuItem, should be performed on the UI thread. Doing so in a background worker thread can cause issues with event handlers on the UI thread.
UX guidelines for the Surface Dial recommend the following:
Text
- Names should be short to fit inside the central circle of the wheel menu
- Names should clearly identify the primary action (a complementary action can be implied)
- Scroll indicates the effect of both rotation directions
- Undo specifies a primary action, but redo (the complementary action) can be inferred and easily discovered by the user
Icons
- Provide a high-quality 64 x 64 pixel PNG image (44 x 44 is the smallest supported)
- Ensure the background is transparent
- The icon should fill most of the image
- A white icon should have a black outline to be visible in high contrast mode
CreateFromKnownIcon(String, RadialControllerMenuKnownIcon) CreateFromKnownIcon(String, RadialControllerMenuKnownIcon) CreateFromKnownIcon(String, RadialControllerMenuKnownIcon) CreateFromKnownIcon(String, RadialControllerMenuKnownIcon)
Creates a custom tool (using the specified text string and system icon) on the RadialController menu.
public : static RadialControllerMenuItem CreateFromKnownIcon(PlatForm::String displayText, RadialControllerMenuKnownIcon value)public static RadialControllerMenuItem CreateFromKnownIcon(String displayText, RadialControllerMenuKnownIcon value)Public Static Function CreateFromKnownIcon(displayText As String, value As RadialControllerMenuKnownIcon) As RadialControllerMenuItem// You can use this method in JavaScript.
- displayText
- PlatForm::String String String String
The text string to display for the custom tool.
- value
- RadialControllerMenuKnownIcon RadialControllerMenuKnownIcon RadialControllerMenuKnownIcon RadialControllerMenuKnownIcon
The system icon to display for the custom tool.
The custom tool.
Remarks
RadialController menu operations, including CreateFromKnownIcon, CreateFromIcon, CreateFromFontGlyph, CreateFromFontGlyph, ResetToDefaultMenuItems, SetDefaultMenuItems, and TrySelectDefaultMenuItem, should be performed on the UI thread. Doing so in a background worker thread can cause issues with event handlers on the UI thread.
UX guidelines for the Surface Dial recommend the following:
Text
- Names should be short to fit inside the central circle of the wheel menu
- Names should clearly identify the primary action (a complementary action can be implied)
- Scroll indicates the effect of both rotation directions
- Undo specifies a primary action, but redo (the complementary action) can be inferred and easily discovered by the user
Events
Invoked Invoked Invoked Invoked
Occurs when a custom tool is selected from the RadialController menu.
public : event TypedEventHandler Invoked<RadialControllerMenuItem, object>public event TypedEventHandler Invoked<RadialControllerMenuItem, object>Public Event Invoked<RadialControllerMenuItem, object>// You can use this event in JavaScript.
- See Also