9/29/2012

Creating a new WPF

Creating a new Windows Presentation Foundation Application

you will create an empty WPF application using the WPF Application Visual Studio template, and add to the solution the FirstApp project .
  1. Open Microsoft Visual Studio 2010 from Start | All Programs | Microsoft Visual Studio 2010 | Microsoft Visual Studio 2010.
  2. Create a new project in Visual Studio 2010 of type WPF Application like this image.
    Create WPF Application
    Create WPF Application in C#


  3.  To do this, point to New on the File menu, and then click Project. Click Windows in either Visual C#  Installed Templates list. In the Templates pane, click WPF Application, and make sure that .NET Framework 4.0 is selected as the target runtime. Finally, set the project's name to FirstApp, set the location, and then click OK.
  4. If you use Visual Basic you will do the same step 2 and 3 but chase Visual Basic from Installed Templates list like that 
    Create WPF Application by VB.net
    Create WPF Application by VB.net
  5. If you want to change the target framework of the FirstApp to .NET Framework 3.5. In Solution Explorer , right-click the FirstApp project and select Properties.
  6. For C# projects, click the Application tab and select the .NET Framework 3.5 option in the Target Framework dropdown list like that.
  7. Changing the target framework in C# projects
    Changing the target framework in C# projects

  8. For Visual Basic projects, select the Compile tab and click the Advanced Compile Options button. In the Advanced Compiler Settings dialog box select the .NET Framework 3.5 option of the Target Framework dropdown list and click OK like that.
  9. Changing the target framework in Visual Basic projects
    Changing the target framework in Visual Basic projects

    Click Yes in the Target Framework Change message box to confirm that you want to change the target framework.
  10.  To add references to Workflow assemblies. To do this, in Solution Explorer right-click the FirstApp project and select Add Reference. In the Add Reference dialog box, switch to the .NET tab and select:
           System.Activities
           System.Activities.Core.Presentation
           System.Activities.Presentation

    Click OK to add the references like this.
    Adding references to WorkflowModel assemblies
    Adding references to WorkflowModel assemblies



No comments:

Post a Comment