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
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
>
Please examine the attached project and if you have further questions feel free to ask.
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
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.