Closed HardySoftware closed 8 years ago
Hi, can you please post a sample repo with the PRISM stuff set up where this happens please.
I attached my solution here, there are 2 buttons to open 2 tabs. But when I try to drag any of the tab I got the error above.
"No parameterless constructor defined for this object."
You problem is that MainWindow
has a constructor argument. By default, Dragablz is trying to create a new MainWindow, but it relies on a default constructor.
No problem though, you can create a custom IInterTabClient
and manage the construction yourself. Check the various samples to see this.
I see what you are talking here. Let's say I still prefer MainWindow
to keep current constructor, as you suggested I should implement a class to implement IInterTabClient
interface. For now I have service locator to instantiate MainWindow
, probably it is where the problem comes from.
The question is how is the class implementing IInterTabClient
interface initialized? Who/when the class in initialized? I just try to see if it can wire up with my IOC container.
Please check samples.
e.g.
https://github.com/ButchersBoy/Dragablz/blob/master/DragablzDemo/BoundExampleWindow.xaml#L68
I have referenced following nuget packages
My XAML definition