Template and theme to TileViewItem

4 posts, 1 answers
  1. David
    David avatar
    18 posts
    Member since:
    Dec 2010

    Posted 20 Jan 2011 Link to this post

    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
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 24 Jan 2011 Link to this post

    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>>
  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    18 posts
    Member since:
    Dec 2010

    Posted 24 Jan 2011 Link to this post

    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
  5. Answer
    Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 24 Jan 2011 Link to this post

    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>>
Back to Top