Hello!
I have a window, in which i have many controls, UserControls or controls derived from other controls (and grids and frames).
It works fine if i DON'T add any event to ANY of the controls i have in my window (in XAML). I have many other events that don't cause this, but if i add a new event. It will crash.
Example:
This is the control i would like to add my event to:
<con:MyControl Content="Hello" Grid.Column="3" Width="90"/>
So, i change it into:
<con:MyControl Content="Hello" Grid.Column="3" Width="90" Click="Hello_Click"/>
The application compiles...
But then, this happens:
'Set connectionId threw an exception.' Line number '53' and line position '22'.
InnerException:
{"Unable to cast object of type 'System.Windows.Controls.Button' to type 'MyNamespace.MyClass.MyControl'."}
If i now remove
Click="Hello_Click"
It works perfectly fine!