2014-02-07 2 views
0

어떻게이 일을 달성 할 수 있습니까?이미지 탭이있는 목록 상자

항목 1 | X item2 | X item3 | X

는 항목 1로, 항목 2는, 항목 3 이벤트를 인 selectionchanged하고 X이에서 나는이

<telerikPrimitives:RadDataBoundListBox 
    x:Name="AddressListBox" 
    ItemsSource="{Binding hereRestAddressDetail}" 
    SelectedItem="{Binding hereRestDetail}" 
    SelectionChanged="AddressListBox_SelectionChanged" 
    ItemAnimationMode="PlayAll" 
    EmptyContent=""> 
    <telerikPrimitives:RadDataBoundListBox.ItemTemplate> 
     <DataTemplate> 
      <Grid Margin="0,0,0,10"> 
       <Grid.ColumnDefinitions> 
        <ColumnDefinition Width="Auto"/> 
        <ColumnDefinition Width="*"/> 
        <ColumnDefinition Width="Auto" /> 
       </Grid.ColumnDefinitions> 
       <Grid.RowDefinitions> 
        <RowDefinition Height="*" /> 
        <RowDefinition Height="Auto" /> 
       </Grid.RowDefinitions> 

       <Rectangle Grid.Column="0" Grid.RowSpan="2" Width="10"> 
        <Rectangle.Fill> 
         <SolidColorBrush Color="{StaticResource PhoneAccentColor}"/> 
        </Rectangle.Fill> 
       </Rectangle> 
       <StackPanel Grid.Column="1" Grid.RowSpan="2" > 
        <StackPanel Orientation="Horizontal"> 
         <TextBlock Text="{Binding LocalizedResources.by, 
              Source={StaticResource LocalizedStrings}}" 
            Style="{StaticResource PhoneTextNormalStyle}"/> 
         <TextBlock Text="{Binding creator}" Margin="-8,0,0,0" 
            Style="{StaticResource PhoneTextAccentStyle}"/> 
        </StackPanel> 
        <TextBlock Text="{Binding street}" 
           TextWrapping="Wrap" 
           Style="{StaticResource PhoneTextLargeStyle}" /> 
        <TextBlock Text="{Binding formatedStreet}" 
           TextWrapping="Wrap" 
           Style="{StaticResource PhoneTextSubtleStyle}" /> 
       </StackPanel> 
       <Image Source="{Binding ratingButton}" Grid.Column="2" 
         Stretch="Uniform" Width="80" 
         Tag="{Binding Id}" Tap="rate_Tap"/> 
       <TextBlock Text="{Binding ratingValue}" HorizontalAlignment="Center" 
          TextWrapping="Wrap" Grid.Column="2" Grid.Row="1" 
          Style="{StaticResource PhoneTextSubtleStyle}"/> 
      </Grid> 
     </DataTemplate> 
    </telerikPrimitives:RadDataBoundListBox.ItemTemplate> 

</telerikPrimitives:RadDataBoundListBox> 

을 시도했지만 나는 이미지로 누를 때 내 이벤트를 실행합니다

탭 이벤트와 이미지 (이다 조건을 그냥 MessageBox 표시와 함께 테스트)하지만 그 후에 또한 내 SelectionChanged 이벤트를 실행 ...

이미지를 두 드릴 때 트리거되는 이미지 탭 이벤트를 지정하는 방법은 무엇입니까?

답변

0

이 작동합니다 :

bool ignoreSelectionChanged; 
void rate_Tap(...) { 
    ignoreSelectionChanged = true; 
    //do you image tap things here 
} 
void AddressListBox_SelectionChanged(...) { 
    if(ignoreSelectionChanged) { 
     ignoreSelectionChanged = false; //reset the bool, so that it will skip only once 
     return; 
    } 
    //do your things on selection change here 
}