c# - detect which item is selected by the hand pointer (not mouse) in listbox wpf -


is there similar way detect item in listbox wpf had been selected kinect v2 hand pointer? tried use selected trigger on listbox , error says: 'listbox' not contain definition 'selected' , no extension method 'selected' accepting first argument of type 'listbox'

                    <listbox x:name="listbox" verticalalignment="bottom"  itemtemplate="{dynamicresource itemtemplate11}" itemssource="{binding collection}" selected="listbox_selected">                     <listbox.itemspanel>                         <itemspaneltemplate>                             <stackpanel orientation="horizontal"/>                         </itemspaneltemplate>                     </listbox.itemspanel>                 </listbox>   public partial class mainwindow {     /// <summary>     /// initializes new instance of <see cref="mainwindow"/> class.      /// </summary>     public mainwindow()     {         this.initializecomponent();          kinectregion.setkinectregion(this, kinectregion);          app app = ((app)application.current);         app.kinectregion = kinectregion;          // use default sensor         this.kinectregion.kinectsensor = kinectsensor.getdefault();      }      private void listbox_selected(object sender, routedeventargs e)     {          messagebox.show(listbox.selectedindex.tostring());     }    } 

huh? listbox has selectionchanged event , selecteditem property. selected event on listboxitem. trap selectionchanged event on listbox itself.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -