This question is locked. New answers and comments are not allowed.
Does the VirtualizingWrapPanel support items of different widths?
For example, I have a list box which contains a list of Tile. I use a DataTemplateSelector to look at a property on a tile to select the DataTemplate to render the Tile with. Depending on the tile type, the width will be a different size. Is this possible with this wrap panel?
Relevant Snippets of code Im use:
For example, I have a list box which contains a list of Tile. I use a DataTemplateSelector to look at a property on a tile to select the DataTemplate to render the Tile with. Depending on the tile type, the width will be a different size. Is this possible with this wrap panel?
Relevant Snippets of code Im use:
<
ListBox
x:Name
=
"lstStaticNavOptions"
ItemsSource
=
"{Binding StartTileList}"
Background
=
"Transparent"
BorderThickness
=
"0"
ScrollViewer.VerticalScrollBarVisibility
=
"Disabled"
ScrollViewer.HorizontalScrollBarVisibility
=
"Disabled"
HorizontalContentAlignment
=
"Stretch"
Style
=
"{StaticResource TileListBoxStyle}"
ItemTemplate
=
"{StaticResource dtTileChooser}"
>
<
DataTemplate
x:Key
=
"dtTileChooser"
>
<
templates:TileTemplateSelector
Content
=
"{Binding}"
>
<
templates:TileTemplateSelector.RefreshTrainingStatusTemplate
>
<
DataTemplate
>
<
Grid
Margin
=
"2 0"
Width
=
"120"
Height
=
"120"
Background
=
"Red"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
TextBlock
Text
=
"{Binding TileStatus}"
Grid.Row
=
"1"
VerticalAlignment
=
"Top"
TextAlignment
=
"Center"
TextWrapping
=
"Wrap"
/>
</
Grid
>
</
DataTemplate
>
</
templates:TileTemplateSelector.RefreshTrainingStatusTemplate
>
<
templates:TileTemplateSelector.MyDocumentsStatusTemplate
>
<
DataTemplate
>
<
Grid
Margin
=
"2 0"
Width
=
"250"
Height
=
"120"
Background
=
"#FF169FDC"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
TextBlock
Text
=
"{Binding TileStatus}"
Grid.Row
=
"1"
VerticalAlignment
=
"Top"
TextAlignment
=
"Center"
TextWrapping
=
"Wrap"
/>
</
Grid
>
</
DataTemplate
>
</
templates:TileTemplateSelector.MyDocumentsStatusTemplate
>
</
templates:TileTemplateSelector
>
</
DataTemplate
>
<
Style
x:Key
=
"TileListBoxStyle"
TargetType
=
"ListBox"
>
<
Setter
Property
=
"Padding"
Value
=
"0"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"0"
/>
<
Setter
Property
=
"ScrollViewer.HorizontalScrollBarVisibility"
Value
=
"Disabled"
/>
<
Setter
Property
=
"ItemsPanel"
>
<
Setter.Value
>
<
ItemsPanelTemplate
>
<
telerik:VirtualizingWrapPanel
Orientation
=
"Horizontal"
ItemHeight
=
"120"
ItemWidth
=
"120"
/>
</
ItemsPanelTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>