How to set FontSize in Avalonia UI specifically only for the Android version of the application?

I’m writing a cross-platform application using the Avalonia UI Community Toolkit. and it turned out that one of my TextBlocks
does not fit on the screen when launched on the phone. how to set FontSize for this TextBlock was specifically for the android version. for example for the Desktop version this is 24, and for Android it is 20

I tried to do this using ChatGPT but nothing worked

here is an example

axaml markup


  <Border Grid.Row="0" Background="#2576f7" Height="28" MaxHeight="28">
  <Grid>
  <Button Background="Transparent" HorizontalAlignment="Left" Content="Back" FontFamily="Arial" FontSize="16" FontWeight="Bold" Command="{Binding NavigateToSelectItemMorphologyTestPageCommand}">
  <Button.Styles>
  <Style Selector="Button:pointerover /template/ ContentPresenter">
  <Setter Property="Background" Value="Transparent"/>
  </Style>
  </Button.Styles>
  </Button>
  <TextBlock x:Name="HeaderText" Text="long text that doesn't fit on the page " FontFamily="Arial" FontSize="24" FontWeight="Bold" TextAlignment="Center"/>
  </Grid>
  </Border>

and just the text size of 24 does not fit on the page on the Telophane screen, but everything is fine on the computer screen.

This is what ChatGPT advised me.

...ViewModel


[ObservableProperty]
 private bool isAndroid;

 public ...ViewModel()
 {
 IsAndroid = RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID"));
 }

and change the markup

<UserControl.Resources>
 <Style x:Key="HeaderTextStyle" TargetType="TextBlock">
 <Setter Property="FontFamily" Value="Arial" />
 <Setter Property="FontSize" Value="24" />
 <Style.Triggers>
 <DataTrigger Binding="{Binding IsAndroid}" Value="True">
 <Setter Property="FontSize" Value="20" />
 </DataTrigger>
 </Style.Triggers>
 </Style>
 </UserControl.Resources>

 <Grid Background="#ffdadada">
 <ScrollViewer VerticalScrollBarVisibility="Visible">
 <Grid>
 <Grid.RowDefinitions>
 <RowDefinition Height="Auto"/>
 <RowDefinition Height="*"/>
 </Grid.RowDefinitions>

 <Border Grid.Row="0" Background="#2576f7" Height="28" MaxHeight="28">
 <Grid>
 <Button Background="Transparent" HorizontalAlignment="Left" Content="Back" FontFamily="Arial" FontSize="16" FontWeight="Bold" Command="{Binding NavigateToSelectItemTestRussianPageCommand}">
 <Button.Styles>
 <Style Selector="Button:pointerover /template/ ContentPresenter">
 <Setter Property="Background" Value="Transparent"/>
 </Style>
 </Button.Styles>
 </Button>
 <TextBlock Text="long text that doesn't fit on the page" FontWeight="Bold" TextAlignment="Center" Style="{StaticResource HeaderTextStyle}"/>
 </Grid>
 </Border>

but there were a lot of errors
1.
Error (active) AXN0002 XamlX.XamlParseException: Unable to resolve type DataTrigger from namespace https://github.com/avaloniaui Line 14, position 6.
2. Error (active) CS0103 The name 'InitializeComponent' does not exist in the current context

but I couldn’t fix them and I also couldn’t find a way to do it differently

sorry for my english as it is not my native language

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật