c# - Why is my Button event is not occuring? -
i having issue button event not occuring
basically have cart items listed in listbox. when delete button clicked item deleted list box.
i tried debugging, seems not call method when button clicked.
in ticketscreen.xaml file specify button in template:
<datatemplate x:key="tickettemplate"> <stackpanel orientation="horizontal" horizontalalignment="left" height="50"> ... <button name="remove" width="35" height="35" fontfamily="resources/#charlemagnestd-regular.otf" fontsize="24" click="removecartitem" grid.column="5" mousemove="remove_mousemove">x</button> ... </stackpanel> </datatemplate>
my list box following:
<listbox name="ticketitems" itemssource="{binding}" itemtemplate="{staticresource tickettemplate}" grid.row="3" grid.columnspan="6" background="transparent" borderbrush="transparent" ishittestvisible="false"> </listbox>
my method removecartitem in ticketscreen.xaml.cs:
private void removecartitem(object sender, routedeventargs e) { console.writeline("testingcartremove"); }
am missing obvious? thx in adv! :)
edit: there seems infront of it... maybe listbox? how make not clicking listbox, can click on things within stackpanel, contents of list box.
ishittestvisible="false" listbox disabling click event button. makes content within listbox invisible hit-test well.
Comments
Post a Comment