wpf - Listbox of hyperlinks won't show clicked hyperlink as selected or current item -
i have listbox hyperlinks in 1 of grid cells. when click on of items in listbox, current item first record in listbox , selected item null. here wpf. doing wrong?
<datatemplate x:key="celltemplate.inputmanagerslist"> <stackpanel orientation="horizontal"> <listbox itemssource="{binding path=inputmanagers}" horizontalalignment="left"> <listbox.itemtemplate> <datatemplate> <stackpanel orientation="horizontal"> <textblock> <hyperlink name="inputmanagername" command="{binding relativesource={relativesource findancestor, ancestortype={x:type usercontrol}}, path=datacontext.openinputmanagerviewcommand}" commandparameter="{binding relativesource={relativesource findancestor, ancestortype={x:type listbox}}}"> <textblock text="{binding path=name}" /> </hyperlink> </textblock> </stackpanel> </datatemplate> </listbox.itemtemplate> <listbox.style> <style targettype="listbox"> <setter property="horizontalalignment" value="left"/> <setter property="borderthickness" value="0"/> </style> </listbox.style> </listbox> </stackpanel> </datatemplate>
would please bind selecteditem="{binding selectedname}" in list view object.
Comments
Post a Comment