Step 2 of 3: Adding Code to the Application

In the last step you set up a WPF application, but if you run your application the controls currently do nothing. In this step you'll continue by adding code to add functionality to the application.

Complete the following steps:

1.   Navigate to the Solution Explorer, right-click MainWindow.xaml file, and select View Code to switch to Code view.

2.   In Code view, add the following import statements to the top of the page if they are not included:

      Visual Basic

      C#

3.   Add the following event handler to the MainWindow.xaml.cs (or .vb) file, below all the other methods in the MainPage class:

      Visual Basic

      C#

This code handles the SelectedFilesChanged event. When a user selects an image with the C1FilePicker control, the image is customized and added to the ListBox control.

4.   Add the following code to handle the Click events of the Button controls on the page:

      Visual Basic

      C#

 What You've Accomplished

In this step you added code to add functionality to your application. In the next step you'll run your application and observe some of the run-time interactions possible with ComponentOne FilePicker for WPF.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.