How do I pass in an enum inside a message action? for instance,
XAML:
<UserControl.ContextMenu>
<ContextMenu StaysOpen="True">
<MenuItem Header="Arrow"
cal:Message.Attach="ChangeArrowType(LogicArrowEnum.ARROW)"/>
....
ViewModel:
public void ChangeArrowType(LogicArrowEnum arrowType)
{
MessageBox.Show(arrowType); //arrowType is empty!
}
public enum LogicArrowEnum
{
ARROW = 1,
ASSIGN = 2,
IF = 3,
IF_ELSE = 4
}
You just need to pass the Enum value as a string
:
<MenuItem Header="Arrow" cal:Message.Attach="ChangeArrowType('ARROW')"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With