Replies: 1 comment 3 replies
-
When you are dynamically changing a property, don't put it in the control itself. Set it on the style level otherwise it overrides the triggers. Put whatever default value you would like where I put the line:
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've noticed that my ui:Buttons that have style/data triggers attached do not update the "appearance" background colors correctly. Below is a button snippet in my XAML. When "MyScale" is null the button should appear disabled (this currently happens as expected). When "MyScale" is no longer null, I want the button to appear with the "Info" appearance value. I have tried inline and using another style trigger but no success.
<ui:Button Appearance="Info" Grid.Column="1" Grid.Row="3" Content="Settings" HorizontalAlignment="Center" VerticalAlignment="Center" Height="80" Width="130" Command="{Binding ShowSettingsCommand}" TabIndex="7"> <Button.Style> <Style TargetType="ui:Button"> <Style.Triggers> <DataTrigger Binding="{Binding MyScale}" Value="{x:Null}"> <Setter Property="IsEnabled" Value="False"/> </DataTrigger> <Trigger Property="IsEnabled" Value="True"> <Setter Property="Appearance" Value="Info"/> </Trigger> </Style.Triggers> </Style> </Button.Style> </ui:Button>
Beta Was this translation helpful? Give feedback.
All reactions