Using Sender on ActionMessage?

Oct 23, 2013 at 9:53 AM
Hallo,

I want to use the sender on a ActionMessage. Is there any way to pass the sender through the ActionMessag? I found a way in the discussions, but it doesnt work for me.

I have a CustomUsercontrol with a TextBox and a Button, where I want to pass a ClickEvent I created befor.
public partial class ActionBox  : UserControl
{
public event RoutedEventHandler RunActionBox;

        public void RunActionBoxClick(object sender, RoutedEventArgs e)
        {
            if (RunActionBox != null)
            {
                RunActionBox(this, e); // or possibly InnerButtonClick(innerButton, e); depending on what you want the sender to be
            }
        }
}

<my:ActionBox  Grid.Column="1" Grid.Row="2" ImgCollapse="True"  Name="ActionBox"
cal:Message.Attach="[Event RunActionBox] = [Action RunActionBoxClick($this , $eventArgs)]"
VerticalAlignment="Top" Height="28" Margin="0,0,33,0">

public void RunActionBoxClick(object sender, RoutedEventArgs e)
        {
ActionBox ab = (ActionBox)sender:
            switch (ab.Name)
            {
                case "Ab_Kunde":
                    MessageBox.Show(ab.Name);
                    break;
                default:
                    break;
            }
        }
But if I debug like this, the sender is a string and empty?

Any ideas?

Regards
Sean Roddis