Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Howto change glyph of fontimagesource via datatrigger

$
0
0

Hy,
i want to create an Expander that shows the Expander state with an Image.

The code snippet that i found works with an Image and that worked well. But i want to use fontawesome and so i use a fontimagesource.
So now i need to change the glyph of the fontimagesource and don´t know how.

here is my XAML:

<Image
     HeightRequest="20"
     HorizontalOptions="End"
     VerticalOptions="Start"
     WidthRequest="20">
     <Image.Source>
          <FontImageSource
               FontFamily="{StaticResource FontAwesomeSolid}"
               Glyph="{x:Static fontawesome:FontAwesomeIcons.AngleDown}"
               Size="20"
               Color="Gray" />
     </Image.Source>
     <Image.Triggers>
          <DataTrigger
               Binding="{Binding Source={RelativeSource AncestorType={x:Type Expander}}, Path=IsExpanded}"
               TargetType="Image"
               Value="True">
               <Setter Property="**Glyph???**" Value="{x:Static fontawesome:FontAwesomeIcons.AngleUp}" />
          </DataTrigger>
     </Image.Triggers>
</Image>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>