Hi guys!
I’ve got a question about NodeModel buttons.
I created a button with a Button_Click event in the *.xaml:
<Button Click="Button_Click" Content="Do Stuff :)"/>
And then created the Button_Click method in the *.xaml.cs:
private void Button_Click(object sender, RoutedEventArgs e)
{
...
if (some check)
{
throw new System.InvalidOperationException("error message in Dynamo");
}
...
}
All functions under the button’s code are working well, except with System.InvalidOperationException()
, where Dynamo mysteriously crashes. I get a Dynamo crash report but it’s not really informative. It basically points to where it went wrong in my code (which is at the throw new … line).
Does anyone know why? Is it because I’m not implementing the button correctly? Should I rather use a binding? If so, does anyone have a nice example?
Again, many thanks for your help in advance
Michael