Aracılığıyla paylaş


RadialControllerMenuItem.CreateFromIcon Method

Definition

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);
 static RadialControllerMenuItem CreateFromIcon(winrt::hstring const& displayText, RandomAccessStreamReference const& icon);
public static RadialControllerMenuItem CreateFromIcon(string displayText, RandomAccessStreamReference icon);
function createFromIcon(displayText, icon)
Public Shared Function CreateFromIcon (displayText As String, icon As RandomAccessStreamReference) As RadialControllerMenuItem

Parameters

displayText
String

Platform::String

winrt::hstring

The text string to display for the custom tool.

icon
RandomAccessStreamReference

The custom icon to display for the custom tool.

Returns

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

Applies to

See also