Hello,
I'm trying to use the TileView to offer the user the possibility of browsing through a list of work items (viewed as TileItems) and then zoom in on the selected task -> maximizing a certain TileItem.
For this I want to dynamically insert content in the TileItem one it gets maximized.
The current attempt was to set the contentTemplate/LargeContent to a canvas and then insert controls in that canvas.
E.g.
How can I achieve this?
Thanks in advance,
Dragos
I'm trying to use the TileView to offer the user the possibility of browsing through a list of work items (viewed as TileItems) and then zoom in on the selected task -> maximizing a certain TileItem.
For this I want to dynamically insert content in the TileItem one it gets maximized.
The current attempt was to set the contentTemplate/LargeContent to a canvas and then insert controls in that canvas.
E.g.
This all sounds great in theory, unfortunately it doesn't work in practice. :(<
DataTemplate
x:Key
=
"contentTemplate"
>
<
telerik:RadFluidContentControl
ContentChangeMode
=
"Manual"
TransitionDuration
=
"0:0:.5"
State
=
"{Binding State, Converter={StaticResource tileConverter}}"
>
<
telerik:RadFluidContentControl.SmallContent
>
<
Image
Source
=
"{Binding Name}"
Stretch
=
"None"
/>
</
telerik:RadFluidContentControl.SmallContent
>
<
telerik:RadFluidContentControl.Content
>
<
Image
Source
=
"{Binding Name}"
Stretch
=
"None"
/>
</
telerik:RadFluidContentControl.Content
>
<
telerik:RadFluidContentControl.LargeContent
>
<
Canvas
x:Name
=
"MyCanvas"
></
Canvas
>
</
telerik:RadFluidContentControl.LargeContent
>
</
telerik:RadFluidContentControl
>
</
DataTemplate
>
And then in the code behind I would catch the maximize event and insert controls is the canvas.Private
Sub
tileView1_TileStateChanged(sender
As
Object
, e
As
RadRoutedEventArgs)
Dim
item
As
RadTileViewItem = TryCast(e.OriginalSource, RadTileViewItem)
If
item IsNot
Nothing
Then
If
item.TileState = TileViewItemState.Maximized
Then
Dim
fluidControl
As
RadFluidContentControl = item.ChildrenOfType(Of RadFluidContentControl)().First()
Dim
lCanvas
As
Canvas = TryCast(fluidControl.Content, Canvas)
If
lCanvas IsNot
Nothing
Then
Dim
lTextBox
As
New
TextBox()
lTextBox.Width = 200
lTextBox.Height = 30
lTextBox.Text =
"This is a test"
lTextBox.BorderBrush =
New
SolidColorBrush(Color.FromArgb(100, 200, 104, 231))
lTextBox.BorderThickness =
New
Thickness(3.0R)
lTextBox.SetValue(Canvas.TopProperty, 250.0R)
lTextBox.SetValue(Canvas.LeftProperty, 750.0R)
lCanvas.Children.Add(lTextBox)
End
If
End
If
End
If
End
Sub
How can I achieve this?
Thanks in advance,
Dragos