Tools

Namespaces

Variants

Views

Actions

Search

Contents

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Talk:Having multiple App names while sharing AppResources

Contents

Manikanthr - A great solution to create multiple apps

Hi,
Thanks for this article as this helped me to achieve non-duplication. I will explain my problem, which is pretty much similar to your problem statement,
I have referred all of my classes(Mainpage.xaml, Page01.xaml, Page02.xaml and their corresponding .cs files). My sub-project does not have any classes, which I have referred from base. Now I want to use the sub project's resource file to read data. Basically it is AppResources.resx file, how do I get string value from the sub-project's AppResources in my project.

Influencer - yes

Basically it's the same process with resx files as with xaml and cs. You add the resources as link. You'll need a link to the LocalizedStrings class, too. The problem is just that you can't do special handling in the resources depending on a proproc define.
HTH,

I think that there is more we could add to this article to make it even more useful. First of all, I would broaden the scope; what you're really talking about here is sharing code and resources among different apps. So I would probably change the title to be something closer to what the discussion thread is called, maybe even the same thing "Performing code reuse in Windows Phone 8".

I might suggest structuring it as follows:

Introduction (and then merge "Problem Details" into this as well)

What type of data can be shared (code, resources, resx files) and what cannot (dataTemplates, styles)

For example it seems that you can't share code between WinRT and WP because they use different UIs.

Sharing code within the same namespace vs. sharing code between different namespaces

Referring to a child's resources vs. referring to a parent's resources - what are the differences?

Types of things that make code more reusable (using a pure MVVM implementation)
What might affect this (whether the apps share the same UI namespace)
Ways to reuse code

Putting code in a separate assembly and referencing it

Using Add as Link

Implement a datasource in code that gives different strings for the different versions (you can use preproc defines here) or

implement a value converter

Using portable class libraries

Using directives

For each method give instructions for how to do it, what kind of data this is best suited for, any kinds of data this is not suited for, and anything specific the developer should know.

Next, a "Case Study" section that shows the examples that are already in the wiki.