public void Execute(object parameter) { DiceExpressionParserDetailed diceParser = new DiceExpressionParserDetailed(new StandardDiceRoller()); IComponent diceExpression = diceParser.ParseString(parameter as string); MessageBox.Show($"You got a roll of {diceExpression.Calculate()}"); }