enter image description hereI am migrating my project from Silverlight to WPF and In Silverlight each module has different project and it's own configuration file i.e. App.xaml. But while migrating it in my WPF project I have separate folder for each modules. In WPF we are adding silverlight library files into WPF folder. So how we can initialize app.xaml file in WPF at folder level?
The answer to " So how we can initialize app.xaml file in WPF at folder level?" is:
You cannot do that.
You might be able to do something similar will satisfy your requirements. Assuming you're talking resources.
Consider a single resource in a resource dictionary with an x:Key of "XX".
When you merge that in app.xaml it's added to a hashtable with a key of XX and value of whatever your resource is. That goes into Application.Current.Resources.
If your wpf app then loads any usercontrol, window whatever that uses a dynamicresource XX then it gets that value. Doesn't matter where it is loaded from. That could be a different library or whatever you like.
Resources have scope.
You could therefore merge a resource dictionary at window level. Say you added another resource dictionary in a module. You merge it into Window1's resources and it has something with a x:Key of "XX". Anything in that instance of Window1's visual tree will grab that "new" XX you just merged in. Anything in any other window will still be using that one out of Application.Current.Resources.
You could conceivably merge resource dictionaries at usercontrol level in this way. This is usually a bad idea though because each gets an instance in memory of your resources. That can add up to a lot of memory if you're not careful.
You could therefore arrange things so each module has it's own window ( or some other parent ) which merges in it's own somehow unique resource dictionary. That supplies a more local version of any resources you need.
Or
Maybe the user only navigate to and hence sees one module at a time. Whatever a module is.
You could then merge your resource dictionaries in at application level. Everything gets them then though.