Hi,
i have a custom button with a custom property “IconColor”.
If I change the IconColor value in a WhileTrue, the custom property doesn’t get reset when it goes to false again. I don’t know if i missed something or if this is a bug. Any Ideas?
Hi,
i have a custom button with a custom property “IconColor”.
If I change the IconColor value in a WhileTrue, the custom property doesn’t get reset when it goes to false again. I don’t know if i missed something or if this is a bug. Any Ideas?
hey! could you paste some of your code? Its impossible to say whats wrong without knowing more.
Only reason i can think of is if you’re using Set
instead of Change
. But if that’s not the case, then please paste some of your UX and we’ll figure it out
<SearchButton ux:Name="SearchButton" Alignment="Right" IconColor="Black" PressedColor="Gray">
<Clicked>
<Toggle Target="SearchActive"/>
</Clicked>
</SearchButton>
<WhileTrue ux:Name="SearchActive">
<Change SearchButton.IconColor="White" />
</WhileTrue>
And here is the custom icon button:
<Panel ux:Class="SearchButton" Width="45" Height="45" Margin="5" HitTestMode="LocalBounds">
<float4 ux:Property="IconColor" />
<float4 ux:Property="PressedColor" />
<Circle Width="13" Height="13">
<Stroke ux:Name="Circle" Color="{Property IconColor}" Width="1"/>
</Circle>
<Rectangle Width="7" Height="1" Color="{Property IconColor}" ux:Name="Line">
<Rotation Degrees="-45" />
<Translation X="-10"/>
</Rectangle>
<WhilePressed>
<Change Circle.Color="{Property PressedColor}"/>
<Change Line.Color="{Property PressedColor}"/>
</WhilePressed>
</Panel>
Not exactly sure why its doing exactly that, but in this case i would instead Change the IconColor instead of Circle.Color and Line.Color individually. Here is a quick example:
<Panel ux:Class="Foo" Color="{Property SomeColor}">
<float4 ux:Property="SomeColor" />
<float4 ux:Property="PressedColor" />
<float4 ux:Property="ToggledColor" />
<Clicked>
<Toggle Target="t" />
</Clicked>
<WhileTrue ux:Name="t">
<Change this.SomeColor="{Property ToggledColor}" />
</WhileTrue>
<WhilePressed>
<Change this.SomeColor="{Property PressedColor}"/>
</WhilePressed>
</Panel>
Cool! Good luck!
Feel free to post again if you run into other problems