|
| 1 | +// Licensed to the .NET Foundation under one or more agreements. |
| 2 | +// The .NET Foundation licenses this file to you under the MIT license. |
| 3 | +// See the LICENSE file in the project root for more information. |
| 4 | + |
| 5 | +using Windows.UI.Input; |
| 6 | +using Windows.UI.Xaml.Controls; |
| 7 | + |
| 8 | +namespace Microsoft.Toolkit.Uwp.UI |
| 9 | +{ |
| 10 | + /// <summary> |
| 11 | + /// A model containing options for configuring the Surface Dial support through <see cref="TextBoxExtensions"/>. |
| 12 | + /// </summary> |
| 13 | + public sealed class SurfaceDialOptions |
| 14 | + { |
| 15 | + /// <summary> |
| 16 | + /// Gets an internal cached instance to avoid allocations from <see cref="TextBoxExtensions"/>. |
| 17 | + /// </summary> |
| 18 | + internal static SurfaceDialOptions Default { get; } = new(); |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// Gets or sets a value indicating whether new menu items shouldn't be added automatically. |
| 22 | + /// This should be set to <see langword="true"/> if you provide the <see cref="RadialController"/> yourself. |
| 23 | + /// </summary> |
| 24 | + public bool ForceMenuItem { get; set; } |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// Gets or sets the default icon of the menu item that gets added. |
| 28 | + /// A user will most likely not see this. |
| 29 | + /// Defaults to <see cref="RadialControllerMenuKnownIcon.Ruler"/>. |
| 30 | + /// </summary> |
| 31 | + public RadialControllerMenuKnownIcon Icon { get; set; } = RadialControllerMenuKnownIcon.Ruler; |
| 32 | + |
| 33 | + /// <summary> |
| 34 | + /// Gets or sets the amount the <see cref="TextBox"/> will be modified for each rotation step on the Surface Dial. |
| 35 | + /// This can be any double value. |
| 36 | + /// </summary> |
| 37 | + public double StepValue { get; set; } |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// Gets or sets a value indicating whether to enable the haptic feedback when rotating the dial for the give TextBox. |
| 41 | + /// This is enabled by default. |
| 42 | + /// </summary> |
| 43 | + public bool EnableHapticFeedback { get; set; } = true; |
| 44 | + |
| 45 | + /// <summary> |
| 46 | + /// Gets or sets the minimum value the <see cref="TextBox"/> can have when modifying it using a Surface Dial. |
| 47 | + /// Default is -100.0. |
| 48 | + /// </summary> |
| 49 | + public double MinValue { get; set; } = -100; |
| 50 | + |
| 51 | + /// <summary> |
| 52 | + /// Gets or sets the maximum value the <see cref="TextBox"/> can have when modifying it using a Surface Dial. |
| 53 | + /// Default is 100.0. |
| 54 | + /// </summary> |
| 55 | + public double MaxValue { get; set; } = 100; |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// Gets or sets a value indicating whether to automatically try to focus the next focusable element from the Surface Dial enabled <see cref="TextBox"/>. |
| 59 | + /// This is on by default. |
| 60 | + /// </summary> |
| 61 | + public bool EnableTapToNextControl { get; set; } = true; |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// Gets or sets a value indicating whether to limit the value in the <see cref="TextBox"/> to <see cref="MinValue"/> and <see cref="MaxValue"/>. |
| 65 | + /// </summary> |
| 66 | + public bool EnableMinMaxValue { get; set; } |
| 67 | + } |
| 68 | +} |
0 commit comments