Providing external dependencies to a WPF Custom UserControl?

It depends on how you plan to use the UserControl.

It depends on how you plan to use the UserControl. If you want to be able to use XAML to define the external dependency, then I'd recommend using a Dependency Property. This will allow the property to be settable via XAML and databinding.(This, also, is the more common, more "WPF" way of doing things...) If you're always going to construct the UserControl in code, and add it to an existing project, then using a constructor parameter is fine.

– Matthew Jul 17 '10 at 0:43 @Matthew: Yes, pretty much. If you want to be able to use your class in the designer, you're going to have to do that no matter what, since the designer will require a parameterless constructor.(This is true for Visual Studio's designer as well as Blend. ) That's why I mentioned you can use a constructor parameter, but only if you're going to construct the control via code.

– Reed Copsey Jul 17 '10 at 0:54 Thanks just wanted to make sure I understood the requirements by supporting the designer and blend. Thanks for your prompt answer and comments! – Matthew Jul 17 '10 at 2:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions