Windows Phone 8 で長いリスト セレクターをタップしたときにボタンを表示したい。
C#
this.DisplayedContacts = new ObservableCollection<string>();
this.DataContext = this.DisplayedContacts;
var contacts = new Contacts();
contacts.SearchCompleted += (s, e) =>
{
foreach (var contact in e.Results)
{
Debug.WriteLine(contact.PhoneNumbers.Any()? contact.PhoneNumbers.First().PhoneNumber: string.Empty);
this.DisplayedContacts.Add(contact.DisplayName + " - " +
(contact.PhoneNumbers.Any()
? contact.PhoneNumbers.First().PhoneNumber
: string.Empty));
}
};
contacts.SearchAsync(string.Empty, FilterKind.DisplayName, null);
}
public ObservableCollection<string> DisplayedContacts { get; set; }
private void LongListSelector_Tap_1(object sender,GestureEventArgs e)
{}
xaml コード
<phone:LongListSelector FontSize="50" Foreground="Gray" Tap="LongListSelector_Tap_1" ItemsSource="{Binding}" Margin="0,77,0,0" />