@@ -25,7 +25,10 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
2525 _defaultAutomationPropertiesName = currentValue = ( string ) Control . GetValue ( NativeAutomationProperties . NameProperty ) ;
2626 }
2727
28- var elemValue = ( string ) Element . GetValue ( SemanticProperties . DescriptionProperty ) ;
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+
2932 string newValue = ! string . IsNullOrWhiteSpace ( elemValue ) ? elemValue : _defaultAutomationPropertiesName ;
3033
3134 if ( currentValue is null || currentValue != newValue )
@@ -85,7 +88,10 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
8588 _defaultAutomationPropertiesHelpText = currentValue = ( string ) Control . GetValue ( NativeAutomationProperties . HelpTextProperty ) ;
8689 }
8790
88- var elemValue = ( string ) Element . GetValue ( SemanticProperties . HintProperty ) ;
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+
8995 string newValue = ! string . IsNullOrWhiteSpace ( elemValue ) ? elemValue : _defaultAutomationPropertiesHelpText ;
9096
9197 if ( currentValue is null || newValue != currentValue )
@@ -117,8 +123,9 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
117123 {
118124 _defaultAutomationPropertiesLabeledBy = currentValue = ( UIElement ) Control . GetValue ( NativeAutomationProperties . LabeledByProperty ) ;
119125 }
120-
121- var elemValue = ( VisualElement ) Element . GetValue ( SemanticProperties . DescriptionProperty ) ;
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
122129 FrameworkElement ? nativeElement = null ;
123130
124131 if ( mauiContext != null )
@@ -130,7 +137,9 @@ public static void SetAutomationPropertiesAutomationId(this FrameworkElement Con
130137
131138 if ( currentValue is null || newValue != currentValue )
132139 {
133- Control . SetValue ( SemanticProperties . DescriptionProperty , newValue ) ;
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
134143 }
135144
136145 return _defaultAutomationPropertiesLabeledBy ;
@@ -152,8 +161,11 @@ public static void SetBackButtonTitle(this PageControl Control, Element? Element
152161
153162 static string ConcatenateNameAndHint ( Element Element )
154163 {
155- var name = ( string ) Element . GetValue ( SemanticProperties . DescriptionProperty ) ;
156- var hint = ( string ) Element . GetValue ( SemanticProperties . HintProperty ) ;
164+ #pragma warning disable CS0618 // Type or member is obsolete
165+ var name = ( string ) Element . GetValue ( AutomationProperties . NameProperty ) ;
166+
167+ var hint = ( string ) Element . GetValue ( AutomationProperties . HelpTextProperty ) ;
168+ #pragma warning restore CS0618 // Type or member is obsolete
157169
158170 string separator = string . IsNullOrWhiteSpace ( name ) || string . IsNullOrWhiteSpace ( hint ) ? "" : ". " ;
159171
0 commit comments