OnPlatform control of type x:Double is not accessible as font size #22461
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
platform/android 🤖
platform/iOS 🍎
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
I defined an OnPlatform class of type x:Double in my main Styles.xaml which I want to use for defining different font sizes per platform. The problem is when I want to call the resource via the specified x:Key the font size of the label does not change.
Steps to Reproduce
My Styles.xaml file:
In a ContentPage I created following label:
but the font size of the label does not change to size 12, only when I replace {StaticResource TinyFontSize} with a numeric value.
When I create following resource in the Styles.xaml file:
it would work fine but then I can not change the value depending on the operating system from the main Styles.xaml.
I found an example on Github in the eShop repository: https://github.com/dotnet/eShop/blob/main/src/ClientApp/Views/CheckoutView.xaml.
But even when I checkout this project and run the ClientApp it does not work...
Link to public reproduction project repository
https://github.com/dotnet/eShop/blob/main/src/ClientApp/Views/CheckoutView.xaml.
Version with bug
8.0.21 SR4.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: