c# 4.0 - Display a button when I tap a long list selector -


i want display button, when tap long list selector in 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 code

<phone:longlistselector fontsize="50" foreground="gray" tap="longlistselector_tap_1" itemssource="{binding}" margin="0,77,0,0" /> 

user visibility property hide list , show button. xaml bellow:

<grid x:name="contentpanel" grid.row="1" margin="12,0,12,0" >             <phone:longlistselector x:name="longlist" tap="longlisttap"/>             <button x:name="actionbutton" visibility="collapsed"/> </grid> 

and event handler:

 private void longlisttap(object sender, gestureeventargs e)         {             longlist.visibility = visibility.collapsed;             actionbutton.visibility = visibility.visible;         } 

Comments