views:

56

answers:

0

Let me show the code first, The Control

<ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>

   <Controls:MatrixGrid x:Name="matrixGrid">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Loaded">
                            <cmd:EventToCommand   Command="{Binding MatrixLoaded}"
                                                  CommandParameter="{Binding ElementName=matrixGrid}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>


                </Controls:MatrixGrid>

<ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>

In The ViewModel Class I have

public RelayCommand<MatrixGrid> MatrixLoaded { get; private set; }

In The Constructor of the View Model I have

 MatrixLoaded = new RelayCommand<MatrixGrid>(MatrixGridAction);

Now When I put a Breakpoint on the Function MatrixGridAction, The breakpoint is hit twice. Am I doing something wrong or is this a bug?