Hi,
I have one problem with Fluid Content Control.
I've read the documentation of RadTileView and i've read the "Fluid Content Control" article
(http://www.telerik.com/help/silverlight/radtileview-fluid-content-control.html).
My problem is in this code :
private
void
tivSessions_TileStateChanged(
object
sender, Telerik.Windows.RadRoutedEventArgs e)
{
RadTileViewItem item = e.OriginalSource
as
RadTileViewItem;
if
(item !=
null
)
{
// THIS DOESN'T WORK
RadFluidContentControl fluidControl = item.Content
as
RadFluidContentControl;
// Can't cast item.Content in RadFluidContentControl.
if
(fluidControl !=
null
)
{
switch
(item.TileState)
{
case
TileViewItemState.Maximized:
fluidControl.State = FluidContentControlState.Large;
break
;
case
TileViewItemState.Minimized:
fluidControl.State = FluidContentControlState.Small;
break
;
case
TileViewItemState.Restored:
fluidControl.State = FluidContentControlState.Normal;
break
;
}
}
}
}
item.Content is actually my databind object.
I just can't get the RadFluidContent.
Here is my XAML :
<
Window
x:Class
=
"PDCBrowser.MainWindow"
xmlns:Telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Loaded
=
"Window_Loaded"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
ComboBox
Name
=
"cbbTracks"
DisplayMemberPath
=
"TrackId"
SelectedValuePath
=
"TrackId"
/>
<
Telerik:RadTileView
Name
=
"tivSessions"
TileStateChanged
=
"tivSessions_TileStateChanged"
Grid.Row
=
"1"
ItemsSource
=
"{Binding ElementName=cbbTracks, Path=SelectedItem}"
>
<
Telerik:RadTileView.ItemTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding ShortTitle}"
TextWrapping
=
"WrapWithOverflow"
></
TextBlock
>
</
DataTemplate
>
</
Telerik:RadTileView.ItemTemplate
>
<
Telerik:RadTileView.ContentTemplate
>
<
DataTemplate
>
<
Telerik:RadFluidContentControl
ContentChangeMode
=
"Manual"
>
<
Telerik:RadFluidContentControl.SmallContent
>
<
TextBlock
>SMALL</
TextBlock
>
</
Telerik:RadFluidContentControl.SmallContent
>
<
Telerik:RadFluidContentControl.Content
>
<
TextBlock
>MEDIUM</
TextBlock
>
</
Telerik:RadFluidContentControl.Content
>
<
Telerik:RadFluidContentControl.LargeContent
>
<
TextBlock
>LARGE</
TextBlock
>
</
Telerik:RadFluidContentControl.LargeContent
>
</
Telerik:RadFluidContentControl
>
</
DataTemplate
>
</
Telerik:RadTileView.ContentTemplate
>
</
Telerik:RadTileView
>
</
Grid
>
</
Window
>
Any ideas ?
Regards.