0
votes

I am using a custom toolkit for all my apps with common functionality that I include in each app. While adding a new control to my toolkit, I found I need to use some code from the Windows Phone Toolkit, and I need to decide how to include the functionality I need from the Windows Phone Toolkit into my own. I believe the following may be my options:

  1. Add a reference to the Windows Phone Toolkit DLL in my toolkit project.
  2. Copy and paste the source files (only the ones I use) from the Windows Phone Toolkit into my project, and change them to be internal. (So that they don't conflict if a user references both my toolkit and the Windows Phone Toolkit.
  3. If there are any other options let me know.

Thanks.

1
Usually first one is the right one, which kind of conflicts you imagine here? - Adriano Repetti
@Adriano Well, for the first option, say a user wants to use my Toolkit, and only my Toolkit. Wouldn't such a user need to add a reference to both my toolkit and the Windows Phone Toolkit in their project? Wouldn't this scenario add all the extra overhead of having to include the entire Windows Phone Toolkit in their project even though my toolkit only uses part of its functionality/code? - Francisco Aguilera
No, they won't need to add a reference to Windows Phone Toolkit (of course if you do not expose any public method with a parameter of a type from that toolkit). Second assertion is true, you'll need to deploy that assembly too. Do you care? Is its size big enough to have to care about it? Will your users use all features exported by your framework? Is it an option they include your source code in their projects to save few kb? IMO no and moreover you won't get updates from WPT for free. IMO it's not something we have to care about nowadays (cum grano salis...) - Adriano Repetti
@Adriano Well, its actually 3MB worth of DLL's they would have to include (localization DLLs), but I see your point. Put your response as an answer so I can mark it. - Francisco Aguilera
Well, if you don't plan to support all languages supported by WPT then you may exclude them. If you prefer to do not deploy them you may even embed WPT DLLs in your DLL. Not as source code but as binaries. - Adriano Repetti

1 Answers

0
votes

From @Adriano Usually first one is the right one. No, they won't need to add a reference to Windows Phone Toolkit (of course if you do not expose any public method with a parameter of a type from that toolkit). Second assertion is true, you'll need to deploy that assembly too. Do you care? Is its size big enough to have to care about it? Will your users use all features exported by your framework? Is it an option they include your source code in their projects to save few kb? IMO no and moreover you won't get updates from WPT for free. IMO it's not something we have to care about nowadays (cum grano salis...)