Last active
March 14, 2025 18:29
-
-
Save darinkes/5c3b4317099e060a7d7c9c4e0bc68682 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Works--> | |
<Image Source="resm:CrossTestAppAvalonia.Images.info2_blue.png" Width="32" Height="32" Margin="5"/> | |
<!--Works--> | |
<Image Source="resm:CrossTestAppAvalonia.Images.warning2_yellow.png" Width="32" Height="32" Margin="5"/> | |
<!--Works--> | |
<TextBox Name="textbox" Margin="5"> | |
<i:Interaction.Behaviors> | |
<ia:DataTriggerBehavior Binding="{Binding MyProperty.Boolean}" ComparisonCondition="Equal" Value="true"> | |
<ia:ChangePropertyAction TargetObject="{Binding #textbox}" PropertyName="Text" Value="info2_blue.png" /> | |
</ia:DataTriggerBehavior> | |
<ia:DataTriggerBehavior Binding="{Binding MyProperty.Boolean}" ComparisonCondition="Equal" Value="false"> | |
<ia:ChangePropertyAction TargetObject="{Binding #textbox}" PropertyName="Text" Value="warning2_yellow.png" /> | |
</ia:DataTriggerBehavior> | |
</i:Interaction.Behaviors> | |
</TextBox> | |
<!--Stays Empty--> | |
<Image Name="image" Width="32" Height="32" Margin="5"> | |
<i:Interaction.Behaviors> | |
<ia:DataTriggerBehavior Binding="{Binding MyProperty.Boolean}" ComparisonCondition="Equal" Value="true"> | |
<ia:ChangePropertyAction TargetObject="{Binding #image}" PropertyName="Source" Value="resm:CrossTestAppAvalonia.Images.info2_blue.png" /> | |
</ia:DataTriggerBehavior> | |
<ia:DataTriggerBehavior Binding="{Binding MyProperty.Boolean}" ComparisonCondition="Equal" Value="false"> | |
<ia:ChangePropertyAction TargetObject="{Binding #image}" PropertyName="Source" Value="resm:CrossTestAppAvalonia.Images.warning2_yellow.png" /> | |
</ia:DataTriggerBehavior> | |
</i:Interaction.Behaviors> | |
</Image> | |
<!--Sets Propery Boolean true/false--> | |
<Button Content="Click Me" VerticalAlignment="Center" HorizontalAlignment="Center" Click="Button_Click"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Image Width="32" Height="32"> | |
<Image.Style> | |
<Style TargetType="Image"> | |
<Style.Triggers> | |
<DataTrigger Binding="{Binding MyProperty.Boolean}" Value="True"> | |
<Setter Property="Source" Value="../Images/info2_blue.png"/> | |
</DataTrigger> | |
<DataTrigger Binding="{Binding MyProperty.Boolean}" Value="False"> | |
<Setter Property="Source" Value="../Images/warning2_yellow.png"/> | |
</DataTrigger> | |
</Style.Triggers> | |
</Style> | |
</Image.Style> | |
</Image> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment