wpf - Listview control template. How to add an event to command? -
<listview x:name="listviewpoducts" selectionmode="single" itemssource="{binding productgroups}" selecteditem="{binding selectedproductgroup}" scrollviewer.horizontalscrollbarvisibility="disabled" scrollviewer.verticalscrollbarvisibility="auto" background="{staticresource nouvemlightbackgroundbrush}"> <listview.itemspanel> <itemspaneltemplate> <wrappanel orientation="vertical" /> </itemspaneltemplate> </listview.itemspanel> <listview.itemcontainerstyle> <style targettype="{x:type listviewitem}"> <setter property="width" value="auto"/> <setter property="height" value="auto"/> <setter property="template"> <setter.value> <controltemplate targettype="listviewitem"> <border background="transparent" > <button name="button" style="{staticresource stylebuttontouchscreenmenu}" ishittestvisible="false"> <grid> <textblock text="{binding name}" fontsize="{binding source={x:static global:applicationsettings.touchscreenmenubuttonfontsize}}" horizontalalignment="center" verticalalignment="center" textalignment="center" textwrapping="wrap" /> </grid> <i:interaction.triggers> <i:eventtrigger eventname="previewmouseup"> <command:eventtocommand command="{binding groupselectedcommand}" /> </i:eventtrigger> </i:interaction.triggers> </button> </border> <controltemplate.triggers> <trigger property="isselected" value="true"> <setter targetname="button" property="background" value="{staticresource nouvemsecondarymainbrush}"/> </trigger> </controltemplate.triggers> </controltemplate> </setter.value> </setter> </style> </listview.itemcontainerstyle> <listview.resources> <style targettype="{x:type scrollbar}" basedon="{staticresource stylescrollbartouchscreennarrow}"/> </listview.resources> </listview>
hello,
i'm trying add event command trigger buttons contained in listview control template. have application running on clients touchscreen overly sensitive button presses. want handle buttons previewmouseup event around (currently when press button, press whats underneath button i.e. pressing button twice)
however, command handler code doesn't hit in view model.
any appreciated.
set ishittestvisible
"true" button.
Comments
Post a Comment