Example #1
0
        /// <summary>
        /// Helper for setting Name property on a StyledElement.
        /// </summary>
        public static void SetName(StyledElement element, string value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(NameProperty, value);
        }
Example #2
0
        /// <summary>
        /// Helper for setting SizeOfSet property on a StyledElement.
        /// </summary>
        public static void SetSizeOfSet(StyledElement element, int value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(SizeOfSetProperty, value);
        }
Example #3
0
        /// <summary>
        /// Helper for setting LabeledBy property on a StyledElement.
        /// </summary>
        public static void SetLabeledBy(StyledElement element, IControl value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(LabeledByProperty, value);
        }
Example #4
0
        /// <summary>
        /// Helper for setting LiveSetting property on a StyledElement.
        /// </summary>
        public static void SetLiveSetting(StyledElement element, AutomationLiveSetting value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(LiveSettingProperty, value);
        }
Example #5
0
        /// <summary>
        /// Helper for setting IsOffscreenBehavior property on a StyledElement.
        /// </summary>
        public static void SetIsOffscreenBehavior(StyledElement element, IsOffscreenBehavior value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(IsOffscreenBehaviorProperty, value);
        }
Example #6
0
        /// <summary>
        /// Helper for setting IsRowHeader property on a StyledElement.
        /// </summary>
        public static void SetIsRowHeader(StyledElement element, bool value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(IsRowHeaderProperty, value);
        }
Example #7
0
        /// <summary>
        /// Helper for setting ControlTypeOverride property on a StyledElement.
        /// </summary>
        public static void SetControlTypeOverride(StyledElement element, AutomationControlType?value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(ControlTypeOverrideProperty, value);
        }
Example #8
0
        /// <summary>
        /// Helper for setting AccessibilityView property on a StyledElement.
        /// </summary>
        public static void SetAccessibilityView(StyledElement element, AccessibilityView value)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            element.SetValue(AccessibilityViewProperty, value);
        }
Example #9
0
        /// <summary>
        /// Sets the value of the attached <see cref="NameScopeProperty"/> on a styled element.
        /// </summary>
        /// <param name="styled">The styled element.</param>
        /// <param name="value">The value to set.</param>
        public static void SetNameScope(StyledElement styled, INameScope value)
        {
            Contract.Requires <ArgumentNullException>(styled != null);

            styled.SetValue(NameScopeProperty, value);
        }
Example #10
0
        /// <summary>
        /// Sets the value of the attached <see cref="NameScopeProperty"/> on a styled element.
        /// </summary>
        /// <param name="styled">The styled element.</param>
        /// <param name="value">The value to set.</param>
        public static void SetNameScope(StyledElement styled, INameScope value)
        {
            _ = styled ?? throw new ArgumentNullException(nameof(styled));

            styled.SetValue(NameScopeProperty, value);
        }