This is a migrated thread and some comments may be shown as answers.

Template and theme to TileViewItem

3 Answers 249 Views
TileView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 20 Jan 2011, 09:18 AM
Hi,

I'm trying to set a template and the Expression_Dark theme to a tileviewitem, but I don't understand how to set both of them. I thought setting the template theme and then set this template to the tileviewitem, but I guess I don't set the theme to the template correctly. What is the right way of doing this?
I'll appreciate if you could provide me the needed lines of code.

Thank you

3 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 24 Jan 2011, 11:04 AM
Hello David,

 You can't change the Template (the ControlTemplate) of the RadTileViewItem and then set it one of our predefined themes because they work only with the default template.
However you can change the ItemTemplate(HeaderTemplate) and the ContentTemplate (those are DataTemplates) and set a theme with something like this:

<Grid.Resources>
    <DataTemplate x:Key="headerTemplate">
        <TextBlock Text="{Binding Header}"></TextBlock>
    </DataTemplate>
    <DataTemplate x:Key="contentTemplate">
        <TextBlock Text="{Binding Content}"></TextBlock>
    </DataTemplate>
</Grid.Resources>
 
<telerik:RadTileView x:Name="myTileView" telerik:StyleManager.Theme="Expression_Dark"
        ItemTemplate="{StaticResource headerTemplate}" ContentTemplate="{StaticResource contentTemplate}">
</telerik:RadTileView>
If you want to change the default template and use the expression dark theme you should edit the expression dark RadTileViewItem style. 
Please examine the attached project and if you have further questions feel free to ask.


Best wishes,
Zarko
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
David
Top achievements
Rank 1
answered on 24 Jan 2011, 03:19 PM
What I want to do is quit simple. I want to add a close button to every tile. The problem is I want the close button to be aligned to the right in the header part (next to the maximize/minimize button).
That's why I want to change the default template (where the header is aligned to the left and not streched like I need it to be.
To achieve this I don't think the xaml code you provided me will help. In case the only way to do such a thing is to edit the expression dark RadTileViewItem style, how can I edit it?
If you have a better idea I'll be glad to hear it. Now my close button is aligned to the left, but I would like it to be on the right of the header.

Thank you
0
Accepted
Zarko
Telerik team
answered on 24 Jan 2011, 06:30 PM
Hi David,

 Yes, you have to edit the expression dark RadTileViewItem style. The easiest way to do this is in Expression blend. In case you don't have blend in the attached project of my previous post I gave you the original expression dark style, so you could change it in Visual Studio.
In this attached project I've edited the style to have a sample close button so could you please examine it and if you have have further questions don't hesitate to ask.

Kind regards,
Zarko
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
TileView
Asked by
David
Top achievements
Rank 1
Answers by
Zarko
Telerik team
David
Top achievements
Rank 1
Share this question
or