New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FrameworkElement.Triggers support more types of triggers #89

Open
DingpingZhang opened this Issue Dec 5, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@DingpingZhang

DingpingZhang commented Dec 5, 2018

FrameworkElement.Triggers now only accepts EventTriggers type, and we have to write a Style to add other triggers to the element, as shown below:

        <Button>
            <Button.Style>
                <Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
                    <Style.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="Gray" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Button.Style>
        </Button>

I think we need a more simplified xaml syntax to add triggers (Trigger, DataTrigger, MultiTrigger and MultiDataTrigger), just like below:

        <Button>
            <Button.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Background" Value="Gray" />
                </Trigger>
            </Button.Triggers>
        </Button>

@rladuca rladuca added this to the Future milestone Dec 5, 2018

@karelz

This comment has been minimized.

Member

karelz commented Dec 5, 2018

@rladuca I suggest to use just 1 issue type label (although it is not clearly stated in the guide - something to fix). In this sense, each api-suggestion is implicitly an enhancement.

@karelz karelz removed the enhancement label Dec 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment