views:

182

answers:

1

I'm using Microsft Visual C# 2008 and am creating WPF applications. If you create a new solution and pick the WPF application template it lets you provide a single string to name the solution.

It then automatically turns that string into a base project name and a namespace using underscores instead of spaces. It also generates a class that inherits from the application class named App and a starting window with a Grid control in it named Window1.

I want to customize pretty much everything.

What's the simplest method of renaming App, Window1, and the starting namespace which won't corrupt the Solution?

+2  A: 

Follow these steps:

  1. Rename the application and window .xaml's in the solution explorer.

  2. Edit the application's .xaml (App.xaml originally) so the StartupUri points to the new name of the starting window the line will be as follows:

    StartupUri="Window1.xaml"

  3. Edit in the original window's .cs codebehind window so Window1 becomes the new window's name.

  4. Use the mouse on the drop-down after the new window name to copy the changed name elsewhere.

  5. Edit the title of the window.

Fred