If you want to get the double click event on a listview item you can try with this code;
<ListView Grid.Row="0"
Grid.RowSpan="3"
Grid.Column="0"
Width="250"
Height="200"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
AlternationCount="2"
BorderBrush="#FFA8CC7B"
ItemContainerStyle="{StaticResource alternatingStyle}"
ItemsSource="{Binding FromPayerNameList}"
SelectedItem="{Binding SelectedFromPayer, Mode=TwoWay}">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListView}}}" Text="{Binding cpayername}">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding DataContext.PrayerSingleLeftToRightMove, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" CommandParameter="{Binding .}" MouseAction="LeftDoubleClick" />
</TextBlock.InputBindings>
</TextBlock>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
If you want to multiple text binding on listview you can try this:
<ListView Grid.Row="0"
Grid.RowSpan="3"
Grid.Column="0"
Width="300"
Height="200"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
AlternationCount="2"
BorderBrush="#FFA8CC7B"
ItemContainerStyle="{StaticResource alternatingStyle}"
ItemsSource="{Binding FromBinNameList}"
SelectedItem="{Binding SelectedFromBin, Mode=TwoWay}">
<ListView.ItemTemplate>
<DataTemplate>
<TextBlock Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListView}}}">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} | {1}">
<Binding Path="cbinno" />
<Binding Path="cinsplanname" />
</MultiBinding>
</TextBlock.Text>
<TextBlock.InputBindings>
<MouseBinding Command="{Binding DataContext.BinSingleLeftToRightMove, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" CommandParameter="{Binding .}" MouseAction="LeftDoubleClick" />
</TextBlock.InputBindings>
</TextBlock>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Comments
Post a Comment