Hello:
I'm attempting to create a simple WPF UserControl beginning with the default constructor.
public partial class MyControl : UserControl
{
InitializeComponent();
}
Now MyControl
will require access to my database and that connection is initialized and managed externally. What is the best way to provide an external dependent resource ( in this case, a connection ) into my UserControl?
I'm familiar with dependency properties but wasn't quite sure if that was the best choice. Seems kinda like overkill. Normally, I would use constructor injection to pass in object dependencies, is that acceptable when designing a UserControl?