Command binding Unable to cast object of type ‘System.Reflection.RuntimeEventInfo’ to type ‘System.Reflection.MethodInfo’

You don’t bind a command to the Click property. The Click property is for adding a traditional event handler to the Click event. You want to use the Command property to bind your command.

<Button Content="{Binding BackgroundMessage}" 
        HorizontalAlignment="Left"  Width="75"  
        VerticalAlignment="Top" Height="Auto"  Margin="2" 
        Command="{Binding ElementName=MainGrid, 
                          Path=DataContext.AlertClickCommand}" 
        CommandParameter="{Binding}" />

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)