DxContextMenu.IconUrlExpression Property
OBSOLETE
This property is obsolete now. Add the DataMappings tag to markup, define a collection of DxContextMenuDataMapping items, and map item properties to data source fields instead.
Specifies a lambda expression that returns the URL of a menu item icon.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v22.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Browsable(false)]
[Obsolete("This property is obsolete now. Add the DataMappings tag to markup, define a collection of DxContextMenuDataMapping items, and map item properties to data source fields instead.")]
[Parameter]
public Expression<Func<object, string>> IconUrlExpression { get; set; }
Property Value
Type | Description |
---|---|
Expression<Func<Object, String>> | A lambda expression that returns the URL of a menu item icon. |
Remarks
When the Context Menu component is bound to a data source, use the IconUrlExpression
property to specify the lambda expression that returns the URL of a menu item icon.
<DxContextMenu Data="@MenuItems"
IconUrlExpression="(item => (item as TextFormattingMenuItem).IconUrl)">
</DxContextMenu>
@code {
List<TextFormattingMenuItem> menuItems;
abstract class TextFormattingMenuItem {
protected TextFormattingMenuItem(TextFormatting textFormatting, string text) {
TextFormatting = textFormatting;
Text = text;
}
public TextFormatting TextFormatting { get; }
public string Text { get; }
public virtual string IconUrl { get { return null; } }
}
}
For unbound context menus, use the IconUrl property to specify an item’s icon.