Use RadFluidContentControl with MVVM
This article will show you a step-by-step tutorial on how to use RadFluidContentControl
in RadTileView
in a data binding scenario.
-
Create the model that will be used to describe each separate TileViewItem.
-
The
RadTileView
andRadFluidContentControl
use different enum types to describe the current state (small, normal, large). To sync these with theContentState
defined in the custom model, you can useIValueConverters
and data bind the corresponding properties.A converter that converts from ContentState to TileViewItemState and back
A converter that converts from ContentState to FluidContentControlState and back
-
To display the information based on the custom model, define
ItemTemplate
(for the headers of the items) andContentTemplate
(for the content). The state of the model can be bound to the state of the TileViewItems, by using theItemContainerStyle
property. The following code shows how to define the templates, the style and the converters, along with the RadTileView setup. -
To populate the TileView with data, set its
ItemsSource
property.