1

I have to add events in Controls which reides in ResourceDictionary ex. List SelectionChanged Image Tap etc, please suggest how cna i do this

Views-> MainPage.XAML

<Grid x:Name="LayoutRoot" Background="{StaticResource AppBackgroundColor}">
  <phone:Panorama Name="Container" Grid.Row="0" ItemsSource="{Binding}" SelectionChanged="OnSelectionChanged" toolkit:TiltEffect.IsTiltEnabled="True"
                  Background="{StaticResource AppBackground}" TitleTemplate="{StaticResource AppPanoramaTitle}">

      <phone:PanoramaItem Name="GetGalleryItem" Content="{Binding GetGalleryModel}" ContentTemplate="{StaticResource GetGalleryContent}"/>
  </phone:Panorama>

Views->DataTemplates->GetGallery.XAML

                        <Image Source="{Binding THUMB, Converter = {StaticResource ThumbnailConverter}, ConverterParameter = 120}" Width="120" x:Name="testTap"
                               Height="120" Stretch="Fill" />

                    <Image Source="{Binding CategoryImage}" Width="130" Height="130" Stretch="Fill" />
                </Grid>
            </DataTemplate>
        </controls:LongListSelectorEx.ItemTemplate>
    </controls:LongListSelectorEx>
</DataTemplate>

Veejay
  • 89
  • 1
  • 7

1 Answers1

0

For the tap event in your image, you could use the tap key work within your Image tag. such as

Xaml:

<Image Tap="tap_image" Source="{Binding THUMB, Converter = {StaticResource ThumbnailConverter}, ConverterParameter = 120}" Width="120" x:Name="testTap"
                           Height="120" Stretch="Fill" />

.cs

  private void tap_image(object sender, System.Windows.Input.GestureEventArgs e)
        {
         //do whatever you wanted
        }

Yes you could use the SelectionChanged event for a listbox or a longlistselector. Have a look over here

Hope it helps

Community
  • 1
  • 1
Kulasangar
  • 9,046
  • 5
  • 51
  • 82