@@ -25,10 +25,7 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
2525 _defaultAutomationPropertiesName = currentValue = ( string ) Control . GetValue ( NativeAutomationProperties . NameProperty ) ;
2626 }
2727
28- #pragma warning disable CS0618 // Type or member is obsolete
29- var elemValue = ( string ) Element . GetValue ( AutomationProperties . NameProperty ) ;
30- #pragma warning restore CS0618 // Type or member is obsolete
31-
28+ var elemValue = ( string ) Element . GetValue ( SemanticProperties . DescriptionProperty ) ;
3229 string newValue = ! string . IsNullOrWhiteSpace ( elemValue ) ? elemValue : _defaultAutomationPropertiesName ;
3330
3431 if ( currentValue is null || currentValue != newValue )
@@ -88,10 +85,7 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
8885 _defaultAutomationPropertiesHelpText = currentValue = ( string ) Control . GetValue ( NativeAutomationProperties . HelpTextProperty ) ;
8986 }
9087
91- #pragma warning disable CS0618 // Type or member is obsolete
92- var elemValue = ( string ) Element . GetValue ( AutomationProperties . HelpTextProperty ) ;
93- #pragma warning restore CS0618 // Type or member is obsolete
94-
88+ var elemValue = ( string ) Element . GetValue ( SemanticProperties . HintProperty ) ;
9589 string newValue = ! string . IsNullOrWhiteSpace ( elemValue ) ? elemValue : _defaultAutomationPropertiesHelpText ;
9690
9791 if ( currentValue is null || newValue != currentValue )
@@ -123,9 +117,8 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
123117 {
124118 _defaultAutomationPropertiesLabeledBy = currentValue = ( UIElement ) Control . GetValue ( NativeAutomationProperties . LabeledByProperty ) ;
125119 }
126- #pragma warning disable CS0618 // Type or member is obsolete
127- var elemValue = ( VisualElement ) Element . GetValue ( AutomationProperties . LabeledByProperty ) ;
128- #pragma warning restore CS0618 // Type or member is obsolete
120+
121+ var elemValue = ( VisualElement ) Element . GetValue ( SemanticProperties . DescriptionProperty ) ;
129122 FrameworkElement ? nativeElement = null ;
130123
131124 if ( mauiContext != null )
@@ -137,9 +130,7 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
137130
138131 if ( currentValue is null || newValue != currentValue )
139132 {
140- #pragma warning disable CS0618 // Type or member is obsolete
141- Control . SetValue ( AutomationProperties . LabeledByProperty , newValue ) ;
142- #pragma warning restore CS0618 // Type or member is obsolete
133+ Control . SetValue ( SemanticProperties . DescriptionProperty , newValue ) ;
143134 }
144135
145136 return _defaultAutomationPropertiesLabeledBy ;
@@ -161,22 +152,10 @@ public static void SetBackButtonTitle(this PageControl Control, Element? Element
161152
162153 static string ConcatenateNameAndHint ( Element Element )
163154 {
164- string separator ;
165-
166- #pragma warning disable CS0618 // Type or member is obsolete
167- var name = ( string ) Element . GetValue ( AutomationProperties . NameProperty ) ;
168-
169- var hint = ( string ) Element . GetValue ( AutomationProperties . HelpTextProperty ) ;
170- #pragma warning restore CS0618 // Type or member is obsolete
155+ var name = ( string ) Element . GetValue ( SemanticProperties . DescriptionProperty ) ;
156+ var hint = ( string ) Element . GetValue ( SemanticProperties . HintProperty ) ;
171157
172- if ( string . IsNullOrWhiteSpace ( name ) || string . IsNullOrWhiteSpace ( hint ) )
173- {
174- separator = "" ;
175- }
176- else
177- {
178- separator = ". " ;
179- }
158+ string separator = string . IsNullOrWhiteSpace ( name ) || string . IsNullOrWhiteSpace ( hint ) ? "" : ". " ;
180159
181160 return string . Join ( separator , name , hint ) ;
182161
0 commit comments