ToolTipAttribute Class
Specifies the tooltip that is displayed for the target class’ objects.
Namespace: DevExpress.Persistent.Base
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Remarks
You can specify the tooltip for your business class’ property via the ToolTipAttribute or the IModelToolTip.ToolTip property of the BOModel | <Class> | OwnMembers | <Member> node in the Model Editor.
Once set for a class member, the tooltip value is automatically calculated for all related UI elements - List View column headers, controls of Detail View items, as well as for layout groups and captions of layout items (you can customize tooltips for these elements in the Application Model as well).
You can also specify a tooltip using the ToolTip property for a navigation group or item node under the NavigationItems node in the Model Editor. This has no effect for groups in WinForms Navigation Bar with Outlook Style.
In the code below, the ToolTipAttribute is applied to the Task.Contacts property and the ToolTipAttribute.ToolTip text is specified.
public class Task : BaseObject {
// ...
[ToolTip("View, assign or remove contacts for the current task")]
public virtual IList<Contact> Contacts { get; set; } = new ObservableCollection<Contact>();
// ...
}
// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.
The result is demonstrated below.
Windows Forms Application:
ASP.NET Web Forms Application:
In Windows Forms applications, additional ToolTipAttribute.ToolTipTitle and ToolTipAttribute.ToolTipIconType parameters have effect in Detail Views.
Alternatively, you can configure tooltips in the Model Editor. For instance, this approach is useful when you cannot modify the required property implementation in code.
You can see an example of using the ToolTipAttribute attribute in the MainDemo application that is shipped with XAF and installed to %PUBLIC%\Documents\DevExpress Demos 24.1\Components\XAF\MainDemo, by default.