Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Applying a conditional effect to a Label

$
0
0

Hello! I am having quite a bit of trouble trying to add a conditional strikethrough effect to a label. The following generates an error "Can't resolved Effects on Label". I am trying to add a strikethrough effect to a label if the operation type is a certain value - otherwise it should just default to MyStyle.

I'm stuck and I would appreciate any tips! Thanks!

       <Label
                        Style="{StaticResource MyStyle}"
                        Text="{Binding Name}">
                        <Label.Triggers>
                            <DataTrigger
                                Binding="{Binding Name.Operation}"
                                TargetType="Label"
                                Value="2">
                                <Setter Property="Effects">
                                    <Setter.Value>
                                        <effects:StrikethoughEffect />
                                    </Setter.Value>
                                </Setter>
                            </DataTrigger>
                        </Label.Triggers>
                    </Label>

Viewing all articles
Browse latest Browse all 204402

Trending Articles



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