RadialControllerConfiguration
RadialControllerConfiguration
RadialControllerConfiguration
RadialControllerConfiguration
Class
Definition
Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Prerelease APIs are identified by a Prerelease label.
[Contains prerelease APIs.]
Provides configuration details for the RadialController menu.
public : sealed class RadialControllerConfiguration : IRadialControllerConfiguration, IRadialControllerConfiguration2public sealed class RadialControllerConfiguration : IRadialControllerConfiguration, IRadialControllerConfiguration2Public NotInheritable Class RadialControllerConfiguration Implements IRadialControllerConfiguration, IRadialControllerConfiguration2// 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 specify which built-in tools are displayed on the menu, and set the default tool.
- First, in the
ModifySystemDefaultsfunction, we get a reference to the RadialControllerConfiguration object for the Surface Dial (config) by calling GetForCurrentView. - Then, we call SetDefaultMenuItems to specify the default collection of built-in menu items (Volume and Scroll ).
- In the
Select_Volumefunction, we attempt to set the default menu item to Volume by calling TrySelectDefaultMenuItem.
public sealed partial class MainPage : Page
{
RadialControllerConfiguration config;
private void ModifySystemDefaults(object sender, RoutedEventArgs e)
{
config = RadialControllerConfiguration.GetForCurrentView();
config.SetDefaultMenuItems(
new[] { RadialControllerSystemMenuItemKind.Volume,
RadialControllerSystemMenuItemKind.Scroll });
}
private void Select_Volume(object sender, RoutedEventArgs e)
{
config = RadialControllerConfiguration.GetForCurrentView();
config.TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind.Volume);
}
}
In this example, we clear all built-in tools by calling SetDefaultMenuItems and passing an empty collection.
Important
When present, the InkToolbar adds two custom tools to the RadialController menu (pen and stroke size). These tools are not accessible through RadialController APIs such as Items or SetDefaultMenuItems.
private void ClearSystemDefaults(object sender, RoutedEventArgs e)
{
config = RadialControllerConfiguration.GetForCurrentView();
config.SetDefaultMenuItems(
new[] { });
}
Properties
ActiveControllerWhenMenuIsSuppressed ActiveControllerWhenMenuIsSuppressed ActiveControllerWhenMenuIsSuppressed ActiveControllerWhenMenuIsSuppressed
Gets or sets the RadialController to activate when the RadialController menu is suppressed.
public : RadialController ActiveControllerWhenMenuIsSuppressed { get; set; }public RadialController ActiveControllerWhenMenuIsSuppressed { get; set; }Public ReadWrite Property ActiveControllerWhenMenuIsSuppressed As RadialController// You can use this property in JavaScript.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
When the menu is suppressed, the press-and-hold gesture does not cause it to be displayed.
Listen for the ButtonHolding event to implement custom handling of the press-and-hold gesture.
AppController AppController AppController AppController
Prerelease. Gets or sets whether the RadialController object is bound to the main application process rather than a specific app view (or top-level window).
If AppController is set, that radial controller (and menu) is used for the top-level window and all views in the application process (overriding any individual view controllers you have defined).
Note
You must also set IsAppControllerEnabled to true.
public : static RadialController AppController { get; set; }public static RadialController AppController { get; set; }Public Static ReadWrite Property AppController As RadialController// You can use this property in JavaScript.
The RadialController object to bind to the active application.
| Device family |
Windows 10 Insider Preview (introduced v10.0.16257.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v5)
|
Remarks
We recommend creating an app controller in the Loaded handler of your app's main page (or equivalent).
IsAppControllerEnabled IsAppControllerEnabled IsAppControllerEnabled IsAppControllerEnabled
Prerelease. Gets or sets whether the RadialController object is enabled as an AppController and controller events can be handled by your app.
public : static PlatForm::Boolean IsAppControllerEnabled { get; set; }public static bool IsAppControllerEnabled { get; set; }Public Static ReadWrite Property IsAppControllerEnabled As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
true if enabled. Otherwise, false. The default is false.
| Device family |
Windows 10 Insider Preview (introduced v10.0.16257.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v5)
|
Remarks
If AppController is set, that radial controller (and menu) is used for all top-level windows in the application process (all individual view controllers are overridden).
We recommend creating an app controller in the Loaded handler of your app's main page (or equivalent).
IsMenuSuppressed IsMenuSuppressed IsMenuSuppressed IsMenuSuppressed
Gets or sets whether the RadialController menu can be displayed.
public : PlatForm::Boolean IsMenuSuppressed { get; set; }public bool IsMenuSuppressed { get; set; }Public ReadWrite Property IsMenuSuppressed As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
true if the menu is suppressed. Otherwise, false.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
When the menu is suppressed, the press-and-hold gesture does not cause it to be displayed.
Listen for the ButtonHolding event to implement custom handling of the press-and-hold gesture.
Methods
GetForCurrentView() GetForCurrentView() GetForCurrentView() GetForCurrentView()
Retrieves a RadialControllerConfiguration object bound to the active application.
public : static RadialControllerConfiguration GetForCurrentView()public static RadialControllerConfiguration GetForCurrentView()Public Static Function GetForCurrentView() As RadialControllerConfiguration// You can use this method in JavaScript.
The RadialControllerConfiguration object bound to the active application.
- See Also
ResetToDefaultMenuItems() ResetToDefaultMenuItems() ResetToDefaultMenuItems() ResetToDefaultMenuItems()
Restores the RadialController menu to the default configuration.
public : void ResetToDefaultMenuItems()public void ResetToDefaultMenuItems()Public Function ResetToDefaultMenuItems() As void// You can use this method in JavaScript.
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.
- See Also
SetDefaultMenuItems(IIterable)
SetDefaultMenuItems(IIterable)
SetDefaultMenuItems(IIterable)
SetDefaultMenuItems(IIterable)
Specifies which built-in tools are shown on the RadialController menu.
Important
When present, the InkToolbar adds two custom tools to the RadialController menu (pen and stroke size). These tools are not accessible through RadialController APIs such as Items or SetDefaultMenuItems.
public : void SetDefaultMenuItems(IIterable<RadialControllerSystemMenuItemKind> buttons)public void SetDefaultMenuItems(IEnumerable<RadialControllerSystemMenuItemKind> buttons)Public Function SetDefaultMenuItems(buttons As IEnumerable<RadialControllerSystemMenuItemKind>) As void// You can use this method in JavaScript.
- buttons
- IIterable<RadialControllerSystemMenuItemKind> IEnumerable<RadialControllerSystemMenuItemKind> IEnumerable<RadialControllerSystemMenuItemKind> IEnumerable<RadialControllerSystemMenuItemKind>
The default set of commands (RadialControllerSystemMenuItemKind ) available on a RadialController menu.
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.
- See Also
TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind) TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind) TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind) TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind)
Attempts to select and activate a tool from the collection of built-in RadialController tools supported for the current app context.
public : PlatForm::Boolean TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind type)public bool TrySelectDefaultMenuItem(RadialControllerSystemMenuItemKind type)Public Function TrySelectDefaultMenuItem(type As RadialControllerSystemMenuItemKind) As bool// You can use this method in JavaScript.
- type
- RadialControllerSystemMenuItemKind RadialControllerSystemMenuItemKind RadialControllerSystemMenuItemKind RadialControllerSystemMenuItemKind
The built-in tool to select and activate.
true if the tool can be selected; otherwise false.
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.
- See Also