c# - TextEdit Binding becomes null after binding InputBindings -
i had button , textedit this, working correctly:
<dxe:textedit text="{binding searchtext}" /> <button command="{binding searchcommand}" / >
i wanted create search when user hits enter, changed code way :
<dxe:textedit text="{binding searchtext}" > <dxe:textedit.inputbindings> <keybinding key="enter" command="{binding searchcommand}" /> </dxe:textedit.inputbindings> </dxe:textedit> <button command="{binding searchcommand}">
this works, in code, searchtext null. broke when added input bindings, can tell me how prepare this? tried one, searchtext still null.
<keybinding key="enter" command="{binding searchcommand}" commandparameter="{binding path=text, relativesource={relativesource ancestortype={x:type dxe:textedit}}}" />
if remember correctly default updatesourcetrigger property devexpress editors lostfocus (i might wrong on this)
and create code work, have forcefulness source update whenever target value changes, setting updatesourcetrigger propertychangted.
you can read more updatesourcetrigger property on msdn
c# wpf mvvm
No comments:
Post a Comment