views:

58

answers:

1

The control template is for a custom control.

I have seen this question: http://stackoverflow.com/questions/619798/why-does-a-wpf-popup-close-when-its-background-area-is-clicked

However I could not figure out how to bind a command to an event in the control template. I tried this:

<Popup 
                        Name="Popup"
                        Placement="Bottom"
                        IsOpen="{TemplateBinding IsDropDownOpen}"
                        AllowsTransparency="True" 
                        Focusable="True"
                        PopupAnimation="Slide"
                        >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseLeftButtonDown">
                                <GalaSoft_MvvmLight_Command:EventToCommand Command="{TemplateBinding PopupClickedCommand}" PassEventArgsToCommand="True"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Popup>

But the command does not fire.

A: 

Try the PreviewMouseLeftButtonDown event.

nportelli
It is still not firing.
Justin