Apply Your Knowledge
Exercises
5.1. Using Simple Data Binding to Display Information from an Array
This exercise shows you how to populate an array in code and then use simple data binding to display the information on the user interface.
Estimated time: 20 minutes
1. | Create a new Visual C# .NET project to use for the exercises in this chapter. |
2. | Add a new class file to your project. Name the class Computer.cs. Enter the following code in the class file to create a class that has three properties and a constructor:
using System; namespace _316C05Exercises { public class Computer { private String computerName; private String cpu; private Int32 ram; public String ComputerName { get { return computerName; } set { computerName = value; } } public ... |
Get MCAD/MCSD.NET Training Guide (Exam 70-316): Developing and Implementing Windows®-Based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.