Changing style to a RadTileViewItem

10 posts, 0 answers
  1. hightow
    hightow avatar
    17 posts
    Member since:
    Aug 2010

    Posted 26 Aug 2010 Link to this post

    I have customized the RadTileViewItems through RadTileView.ItemTemplate-tag in the xaml, i.e. added some more buttons and labels as I saw fit. The problem I see now is how I can customize the RadTileViewItem  as I dont have references to that in the xaml.

    <telerikNavigation:RadTileView.ItemTemplate>
       <DataTemplate>
          <Grid>>
              <!-- Buttons and Label -->
          </Grid>
       </DataTemplate>
    </telerikNavigation:RadTileView.ItemTemplate>
  2. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 26 Aug 2010 Link to this post

    Hello Helgrim,

    Could you please explain more descriptive what you need to do and what do you mean when you say "I dont have references to that in the xaml"?

    All the best,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. hightow
    hightow avatar
    17 posts
    Member since:
    Aug 2010

    Posted 26 Aug 2010 Link to this post

    In your example-codes you build the xaml like this:
    <RadTileView>
       <RadTimeViewItem>...</RadTileViewItem>
       <RadTileViewItem>...</RadTileViewItem>
    </RadTileView>

    But I have built my xaml like this:
    <RadTileView>
        <RadTileView.ItemTemplate>
            <DataTemplate>...</DataTemplate>
        </RadTileView.ItemTemplate>
        <RadTileView.ContentTemplate>
            <DataTemplate>...</DataTemplate>
        </RadTileView.ContentTemplate>
    </RadTileView>

    As I have no <RadTileViewItem>-tags in my xaml, I find it difficult to know how to change its style.
  5. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 26 Aug 2010 Link to this post

    Hello Helgrim,

    The idea of the templates is to apply them to some data. If your RadTileView is not databound, or if you do not add items somehow from code behind, then the use of templates is meaningless.

    Best wishes,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. hightow
    hightow avatar
    17 posts
    Member since:
    Aug 2010

    Posted 26 Aug 2010 Link to this post

    I just wanted to illustrate the structure of my xaml, and have focus on the design and not the data.

    I set the .DataContext on the UserControl to a ViewModel in codebehind, and bind the RadTileView in the xaml like this:
    <RadTileView ItemsSource="{Binding Path=MyData}">



  7. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 26 Aug 2010 Link to this post

    Hi Helgrim,

    You have bound the RadTileView, added custom templates - everything is fine. What exactly your problem is? I do not uderstand what you meant with this "The problem I see now is how I can customize the RadTileViewItem  as I dont have references to that in the xaml." ?

    Regards,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. hightow
    hightow avatar
    17 posts
    Member since:
    Aug 2010

    Posted 26 Aug 2010 Link to this post

    I have attached a picture that might better illustrate what I want to accomplish.

    In the left corner highlighted with a red background is my custom template. (A grid with a button and a label)
    In the right corner is the standard maximize-togglebutton. How do I customize it. (E.g. change foreground color)

    (I'm more and more convinced that I have to solve this in a more "standard" approach)

    Thanks for your patience. :)
  9. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 27 Aug 2010 Link to this post

    Hello Helgrim,

    If you want to change the foreground of the different RadTileViewItems and for example the logic is based on some property of the databound items, you can use ContainerBindings. If you meant something different, could you please be more descriptive?

    Best wishes,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. hightow
    hightow avatar
    17 posts
    Member since:
    Aug 2010

    Posted 01 Sep 2010 Link to this post

    No, you haven't understood what I want to do here.

    So lets start from the beginning, and take it step by step.
    In short: I want to customize the MaximizeToggleButton. How do I do that?
  11. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 01 Sep 2010 Link to this post

    Hi Helgrim,

    If you want to customize the Maximize ToggleButton, you can add custom style to the ItemContainerStyle property of the RadTileView, which you can get if you edit the template of a RadTileViewItem in Blend and then you can remove the RestoreIcon item (which is placed in the default ControlTemplate of the RadTileViewItem) and add your custom Path object.

    Regards,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner