concept display in category silverlight

appears as: display, display, displays, The display
Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services

This is an excerpt from Manning's book Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services.

In the case of a cross-domain error, you’ll simply get a blank control for the display and an XamlParseException (attribute out of range), which may be trapped in the application-level exception handler. If you want to host cross-domain content, you’ll need to use the NavigateToString method and host an iframe.

In chapter 11, we covered binding. I believe binding to be one of the most important topics for Silverlight developers. One reason behind that is because the DataGrid and DataForm, as well as data annotations for display, all require binding in order to be useful.

Listing 12.10. The Person class with Display attributes attached
public class Person { ... [Display(Name = "Registered", Description = "Check if this person has registered with us.")] public bool IsRegistered { get; set; } [Display(Name = "Marital Status", Description = "Optional marital status information.")] public MaritalStatus MaritalStatus { get; set; } ... }

The result of including the Display attribute with the name and description can be seen in figure 12.5. Note that the MaritalStatus field has its correctly formatted display name shown in the label, and the Registered field shows the information icon with the associated tooltip containing the description property.

Figure 12.5. Portion of a DataForm showing the tooltips with the Description property of the Display attribute and the field captions pulled from the Name property of the same attribute.

The System.ComponentModel.DataAnnotations assembly and namespace found in the Silverlight SDK provide a number of attributes designed to make data validation and display hinting easier for controls such as the DataForm, DataGrid, and some third-party controls. The approach taken by these attributes is to mark up the properties in your entities using attributes in code rather than require code within the properties or external to your entities.

The two main attributes that we’ll cover here are Display and Editable. In chapter 13, we’ll take a look at the validation attributes and how they can further enhance the DataGrid and DataForm.