Friday 15 July 2011

wpf - TextSearch.TextPath timing on DataTemplate? -



wpf - TextSearch.TextPath timing on DataTemplate? -

i have info template:

<usercontrol.resources> <datatemplate x:key="imageitemtemplate"> <stackpanel orientation="horizontal"> <image height="44" source="{binding path}"/> <label content="{binding name}" verticalalignment="center"/> </stackpanel> </datatemplate> </usercontrol.resources>

its combobox.

<combobox itemtemplate="{staticresource imageitemtemplate}" textsearch.textpath="name"/>

this works intended. if on combobox, , nail "k" button on keyboard, seek content within combobox name starts "k".

moving on that, if nail "w" button on keyboard, not seek content within combobox name starts "w". seek content starts "kw".

however, if instead of hitting "w" button after "k" button, instead wait 2-3 seconds before hitting "w", when nail "w" button, seek content starting "w", if dropped search k after few seconds.

i wondering if there way eliminate wait time. want previous search text dropped imemdiately.

nope. looking @ source code textsearcher appears timeout not configurable programmatically. here how timeout value calculated:

/// <summary> /// time until search engine resets. /// </summary> private timespan timeout { { // note: ntuser next (file: windows/ntuser/kernel/sysmet.c) // gpsi->dtlbsearch = dttime * 4; // dtlbsearch = 4 * gdtdblclk // gpsi->dtscroll = gpsi->dtlbsearch / 5; // dtscroll = 4/5 * gdtdblclk // // 4 * doubleclickspeed seems slow search // we'll 2 * doubleclickspeed homecoming timespan.frommilliseconds(safenativemethods.getdoubleclicktime() * 2); } }

and cannot reset search algorithm either, because corresponding properties maintain current search prefix private textsearch class.

wpf combobox

No comments:

Post a Comment