You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2024. It is now read-only.
I am converting my project from Xamarin.Forms 4.6 (which used AppThemeColor) to the latest Xamarin.Forms 4.7 (where AppThemeColor has been replaced with AppThemeBinding). The AppThemeBinding is very hard to work with in general. I have found one scenario which I am not able to convert so that it worked in Xamarin.Forms 4.7.
I have created a HyperlinkSpan custom control. However I am not able to set different color for the light mode and for the dark mode. Here is a simplified version of my code:
publicclassHyperlinkSpan:Span{publicHyperlinkSpan(){this.SetAppThemeColor(Span.TextColorProperty, Color.Blue, Color.Aqua);// ... setting other things such as underline and a TapGestureRecognizer ...}}
This code does not compile because Span does not contain definition of SetAppThemeColor. But if a the control would inherit from Label instead of Span, the method could be used (this is however not usable for my case because I need links in a text). After some searching I have found out that SetAppThemeColor is an extension method defined for VisualElement. Label inherits from VisualElement but Span does not.
Expected Behavior
Everything that was possible with AppThemeColor (that was removed from Xamarin.Forms) should be also possible with new AppThemeBinding.
Actual Behavior
Some things that were possible in Xamarin.Forms 4.6 are not possible in 4.7. This can prevent developers from using the current version.
Basic Information
Version with issue: Xamarin.Forms 4.7
The text was updated successfully, but these errors were encountered:
Description
I am converting my project from Xamarin.Forms 4.6 (which used AppThemeColor) to the latest Xamarin.Forms 4.7 (where AppThemeColor has been replaced with AppThemeBinding). The AppThemeBinding is very hard to work with in general. I have found one scenario which I am not able to convert so that it worked in Xamarin.Forms 4.7.
I have created a HyperlinkSpan custom control. However I am not able to set different color for the light mode and for the dark mode. Here is a simplified version of my code:
This code does not compile because Span does not contain definition of SetAppThemeColor. But if a the control would inherit from Label instead of Span, the method could be used (this is however not usable for my case because I need links in a text). After some searching I have found out that SetAppThemeColor is an extension method defined for VisualElement. Label inherits from VisualElement but Span does not.
Expected Behavior
Everything that was possible with AppThemeColor (that was removed from Xamarin.Forms) should be also possible with new AppThemeBinding.
Actual Behavior
Some things that were possible in Xamarin.Forms 4.6 are not possible in 4.7. This can prevent developers from using the current version.
Basic Information
The text was updated successfully, but these errors were encountered: