#184 – Creating a WPF Application Using Visual Studio

You can create a basic WPF application using Visual Studio 2010.  Open Visual Studio and select File | New | Project.  Then select WPF Application as the template to use for creating the project.

This will generate a project with the project structure shown below.

The project contains:

  • An App class, deriving from System.Windows.Application
    • Has Main() method, defined in automatically generated App.g.i.cs file
    • Empty App.xaml file, defining main <Application> element
    • Empty App.xaml.cs file with partial class for App
  • A MainWindow class, deriving from System.Windows.Window
    • InitializeComponent() method, defined in auto-generated MainWindow.g.i.cs file, which reconstitutes object from XAML file
    • MainWindow.xaml file, containing <Window> object and a child <Grid>
    • Empty MainWindow.xaml.cs file with partial class for MainWindow

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 131 other followers