how do I get item on listbox hold event in windows phone? suppose I have three items in listbox,
1 - abc
2 - def
3 - ghi
If I hold on item "abc" then how do I get that item?
how do I get item on listbox hold event in windows phone? suppose I have three items in listbox,
1 - abc
2 - def
3 - ghi
If I hold on item "abc" then how do I get that item?
This would help you to get list item on hold event:
private void lst_Hold_1(object sender, System.Windows.Input.GestureEventArgs e)
{
string text = (e.OriginalSource as TextBlock).Text;
}
May be this helps you.
<ListBox x:Name="lstBoxTemp" Hold="lstBoxTemp_Hold">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
.......
........
Your template
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
private void lstBoxTemp_Hold(object sender, System.Windows.Input.GestureEventArgs e)
{
var item= (Cast as YourType)(sender as ListBox).DataContext;
}