aspnetmvc-devexpress-dot-web-dot-mvc-dot-imagezoomnavigatorextension-dot-bind-x28-system-dot-object-x29.md
Binds the ImageZoomNavigator to a data source.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public ImageZoomNavigatorExtension Bind(
object dataObject
)
Public Function Bind(
dataObject As Object
) As ImageZoomNavigatorExtension
| Name | Type | Description |
|---|---|---|
| dataObject | Object |
An object representing the bound data source.
|
| Type | Description |
|---|---|
| ImageZoomNavigatorExtension |
A ImageZoomNavigatorExtension object representing the ImageZoomNavigator.
|
// Model
public static class BinaryImages {
public static IEnumerable GetData(int? categoryId = null) {
using(var context = new BinaryImagesContext()) {
if(categoryId != null)
return context.BinaryImages.Where(bi => bi.CategoryID == categoryId.Value).ToList();
return context.BinaryImages.ToList();
}
}
}
// Partial View
@Html.DevExpress().ImageZoomNavigator(settings => {
settings.Name = "zoomNavigator";
...
settings.ImageUrlField = "Images";
settings.LargeImageUrlField = "LargeImages";
settings.ThumbnailUrlField = "Thumbnails";
settings.ZoomWindowTextField = "ZoomText";
settings.ExpandWindowTextField = "ExpandText";
settings.Orientation = Orientation.Horizontal;
...
}).Bind(Model).GetHtml()
See Also
ImageZoomNavigatorExtension Class