I have a window with this code on the xaml
<Button Margin="5" Content="Check" Command="{Binding CheckForUpdatesCommand}" />
...
<i:EventTrigger EventName="SoftwareOutOfDateEvent" SourceObject="{Binding}"><view:InvokeDelegateCommandAction Command="{x:Static view:Commands.ShowMessageOutOfDateVersionCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}" /></i:EventTrigger>
Inside my ViewModel , the CheckForUpdatesCommand raise an event in this way
public event EventHandler SoftwareUpToDateEvent; RootDispatcher.Invoke((Action)delegate() { if (SoftwareUpToDateEvent != null) SoftwareUpToDateEvent.Invoke(this, args); });
Now the problem is that everytime I close and open the window, event add again and again, so the messagebox appears x times I have open my window in the application life.
What I can do to ?