Bug 60209 - A Property resets to default when multiple Triggers setting it to the same value
Summary: A Property resets to default when multiple Triggers setting it to the same value
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-16 15:11 UTC by Daniel Katz
Modified: 2017-12-18 14:57 UTC (History)
2 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Daniel Katz 2017-10-16 15:11:07 UTC
When two Triggers setting a property to the same (non-default) value on different conditions, after the handoff between the last and the first, the actual value resets to default.

For example:

<Label Text="Defaults in two clicks" 
    VerticalOptions="Center" 
    HorizontalOptions="Center">

    <Label.Triggers>

        <DataTrigger TargetType="Label" Binding="{Binding Source={x:Reference me}, Path=FlipFlop}" Value="False">
            <DataTrigger.Setters>
                <Setter Property="TextColor" Value="Red" />
            </DataTrigger.Setters>
        </DataTrigger>

        <DataTrigger TargetType="Label" Binding="{Binding Source={x:Reference me}, Path=FlipFlop}" Value="True">
            <DataTrigger.Setters>
                <Setter Property="TextColor" Value="Red" />
            </DataTrigger.Setters>
        </DataTrigger>

    </Label.Triggers>
</Label>

<Button Clicked="FlipTheFlop" Text="Click" />

private void FlipTheFlop(object sender, EventArgs e)
{
    FlipFlop = !FlipFlop;
}

A full reproduction available in the following repo https://github.com/mmcubit/SameValueTriggerBugRepro
Comment 1 Paul DiPietro [MSFT] 2017-12-18 14:57:21 UTC
Moved to https://github.com/xamarin/Xamarin.Forms/issues/1412