static ProjectItem FindAppDotXaml(EnvDTE.Project currentProject, EnvDTE.Solution currentSolution)
        {
            // First, look for a file named "App.xaml" in the root of the current project:
            foreach (EnvDTE.ProjectItem projectItem in currentProject.ProjectItems)
            {
                string fileName = projectItem.Name;
                if (fileName.ToLowerInvariant() == "app.xaml")
                {
                    return(projectItem);
                }
            }

            // If not found, iterate through all the referencing projects in the solution, and look there:
            foreach (Project project in SolutionProjectsHelper.GetAllProjectsInSolution(currentSolution))
            {
                // Check if the project references the current project:
                if (SolutionProjectsHelper.DoesProjectAReferenceProjectB(project, currentProject))
                {
                    // Find a file named "app.xaml" in the referenced project:
                    foreach (EnvDTE.ProjectItem projectItem in project.ProjectItems)
                    {
                        string fileName = projectItem.Name;
                        if (fileName.ToLowerInvariant() == "app.xaml")
                        {
                            return(projectItem);
                        }
                    }
                }
            }

            return(null);
        }