Some examples show changing the action of the App.xaml assembly from ApplicationDefinition to Page and writing its own Main() , which creates an instance of the App class and calls its Run() method, but this can lead to some undesirable consequences in resolving application resources in App.xaml .
Instead, I suggest creating your own Main() in your own class and setting the launch object for this class in the project properties:
public class EntryPoint { [STAThread] public static void Main(string[] args) { if (args != null && args.Length > 0) {
I am doing this to take advantage of some AppDomain events that must be signed before anything else happens (e.g. AssemblyResolve ). The undesirable consequences of installing App.xaml on a Page that I experienced included my UserControl Views (MV-VM), which did not allow resources stored in App.xaml during development.
Joel B Fant May 27 '11 at 19:10 2011-05-27 19:10
source share