/// <summary>Helper for setting <see cref="ForInputTypesProperty"/> on <paramref name="element"/>.</summary> /// <param name="element"><see cref="FrameworkElement"/> to set <see cref="ForInputTypesProperty"/> on.</param> /// <param name="value">ForInputTypes property value.</param> public static void SetForInputTypes(FrameworkElement element, InputTypeCollection value) { if (element is null) { throw new System.ArgumentNullException(nameof(element)); } element.SetValue(ForInputTypesProperty, value); }
private static InputTypeCollection ConvertFromText(string text) { var typeNames = text.Split(SeparatorChars, StringSplitOptions.RemoveEmptyEntries) .Select(x => x.Trim()) .ToArray(); var inputTypeCollection = new InputTypeCollection(); foreach (var typeName in typeNames) { var match = CompatibleTypeCache.FindType(typeName); inputTypeCollection.Add(match); } return(inputTypeCollection); }
#pragma warning restore SA1202 // Elements must be ordered by access public static void SetForInputTypes(this UIElement element, InputTypeCollection value) => element.SetValue(ForInputTypesProperty, value);