Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
571
Capture a click event in a tile
posted

Hi

What I want to do is place a button or a hyperlink inside of each tile that is created when binding to the set of contact records queried from my database. The tiles are used in the search control which gives the user a simple summary of the contacts info. When this button/link inside of each tile is clicked I want to open up a far more comprehensive user control with a lot more info regarding the contact. How do I capture the click event of say a button inside a tile passing the event handler the ID of the contact that was clicked

 

Regards

Andrew

Parents
No Data
Reply
  • 3071
    Suggested Answer
    posted

    Hi Andrew,
    Look at this sample code:
    <ig:XamTileView ItemsSource="123456789">
      <ig:XamTileView.TilePaneContentTemplate>
        <DataTemplate>
         <StackPanel>
          <TextBlock Text="{Binding}"/>
          <Button Content="More..." Click="MoreInfoClick"/>
         </StackPanel>
       </DataTemplate>
      </ig:XamTileView.TilePaneContentTemplate>
    </
    ig:XamTileView>
    private void MoreInfoClick(object sender, RoutedEventArgs e)
    {
      System.Diagnostics.
    Debug.WriteLine((sender as Button).DataContext);
    }

    You can also display details in the maximized tile.
    Regards,
    Marin

Children