#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
Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: