Question

Out of curiosity, I'd like to know how the Blend interaction (such as in the following example) functionality works behind the hood.

  1. Is Interaction some kind of attached property?
  2. How do you have elements of a control using a different namespace?

Does anyone know of a tutorial or something that goes through an implementation of something like this? i.e how you would do this yourself with just the barebones wpf framework and no other frameworks

<TextBox>
         <i:Interaction.Triggers>
              <i:EventTrigger EventName="LostFocus">
                    ...
              </i:EventTrigger>
          </i:Interaction.Triggers>
</TextBox>
Was it helpful?

Solution

Interaction is the class, Triggers the attached property, access is always like that for attached properties, they can be set on any control. I would recommend reading the documentation.

OTHER TIPS

1 - The System.Windows.Interactivity.Interaction Class defines 2 attached properties:

  • Triggers
  • Behaviors

2 - Those are not "elements of a control", those are Attached Properties, which can be applied to any UI element regardless of the namespace.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top