Binding tile x:Name?

3 posts, 0 answers
  1. Joe
    Joe avatar
    3 posts
    Member since:
    Oct 2017

    Posted 03 Feb 2018 Link to this post

    I'm trying to get the name of the tile when selected but because I'm binding my RadTileList to an observablecollection the tile's do not have that property set, is it possible to bind the tile x:Name property? 
  2. Joe
    Joe avatar
    3 posts
    Member since:
    Oct 2017

    Posted 04 Feb 2018 in reply to Joe Link to this post

    I guess in looking further into this what's more important is setting a Command and CommandParameter for each tile??
  3. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    480 posts

    Posted 07 Feb 2018 Link to this post

    Hello Joe,

    It is not possible to bind the x:Name property since it is not a DependencyProperty. Alternatively you can use FrameworkElement's Tag property. As for binding a command to the RadTiles, you can use an implicit style like so:
    <Style TargetType="{x:Type telerik:Tile}" >
                    <Setter Property="Command" Value="{Binding MyCommand}" />
                    <Setter Property="CommandParameter" Value="{Binding MyCommandParameter}" />
    </Style>

    Please note that if you are using implicit styles, you will have to base the style on the theme's default one.

    I hope this helps. Let me know if I can be of any further assistance.

    Regards,
    Vladimir Stoyanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top