如何在TreeViewItem中两个属性都发生变化时才使MultiTrigger触发?

时间:2018-05-10 13:42:48

标签: c# wpf xaml treeview

我定义了以下MultiTrigger

<MultiTrigger>
    <MultiTrigger.Conditions>
        <Condition Property="IsExpanded" Value="true" />
        <Condition Property="IsSelected" Value="true" />
    </MultiTrigger.Conditions>
    <Setter TargetName="ItemsHost" Property="Visibility" Value="Visible" />
    <MultiTrigger.EnterActions>
        <BeginStoryboard>
            <Storyboard>
                <DoubleAnimation
                    FillBehavior="HoldEnd"
                    Storyboard.TargetName="ItemsHost"
                    Storyboard.TargetProperty="(ItemsPresenter.LayoutTransform).(ScaleTransform.ScaleY)"
                    From="0"
                    To="1"
                    Duration="0:0:0.2" />
            </Storyboard>
        </BeginStoryboard>
    </MultiTrigger.EnterActions>
</MultiTrigger>

我认为只要IsExpandedIsSelectedtrue,它就会触发。现在,只要IsExpanded已经trueIsSelected 更改为True,就会触发。每当属性更改时,我都需要触发它。我怎么能这样做?

0 个答案:

没有答案