Skip to content

RemoveElementAction

branh edited this page Dec 4, 2018 · 1 revision

RemoveElementAction causes some FrameworkElement to be removed when it is triggered.

This behavior removes the element specified by TargetObject or TargetName.

SampleCode

Xaml

<Rectangle x:Name="Rectangle" />
<Button>
  <Behaviors:Interaction.Triggers>
    <Behaviors:EventTrigger EventName="Click">
      <Behaviors:RemoveElementAction TargetName="Rectangle" />
    </Behaviors:EventTrigger>
  </Behaviors:Interaction.Triggers>
</Button>