1

I have a WP7 application which I need to rebrand. I'm using Visual Studio 2012. My problem is how manage brands in the most automatic way.
Lets say I developed the app for the Main Brand, and I need to restyle for the Secondary Brand. Secondary Brand consist in change of Images and part some base styles (the base style are used and thus referenced by other style and templates which are shared). I would prefer to have the XAP with only Images for its own Brand. I need also to have the possibility to use the designer with one brand or another.

I tried to use a TFS Branch for this purpose, it is satisfing but at every merge (new features or bug fix in the Main Branch that must be merged in the Secondary Branch), I need to pay attention to not overwrite Images and Styles (if changed), it is an error prone process and lead to undetected and critical mistake.

I thinking about bring everything back on the main branch and manage Brands by moving all Images and Style that differs, into different 'theme' class libraries but how can I easily switch between references (I need the designer, so at design time) ? Is there a way to have different references for different solution configuration ?

Another option could be to use the Branch and the 2 theme class library, in the secondary branch the app will reference the secondary theme class library. On the paper it seems the best options, both branch will link statically the resources, they will have their designer branded, merge should not impact anything modified in the 'theme' libraries. Before try it i would like to know if anyone has a better option or foresee any problem on this.

Thank You.

1

1 Answer 1

4

I had similar project, and I can share the way I was trying to solve it.

I had following project structure

  • AppName.Common - here all common code, views and data templates defined

  • AppName.Main - here is App.xaml for main project, Resources with specific styles and images

  • AppName.Branded - here is App.xaml for branded project, Resources with specific styles and images. Also in App.xaml I configure IoC container, because some of behaviors were different for Branded and for Main proj.

All styles are defined in App.xaml in Resourced dictionary. So, in runtime app can resolve them. Sometimes you need to reopen solution, and also ReSharper can't support in, it fails to resolve you styles.

Blend for VS can support this structure. You just select current project as a Start-up proj.

Hope it will help you.

Don't forget, that if you navigate to View from other assembly, you need to change path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.