c# - Where does keyboard focus go when the focused WPF element is removed? -


i have custom treeview-like control in panel in application. click on items receive keyboard focus.

it's possible select set of items in tree , cut or remove them pressing ctrl-x or delete. when tree items removed, keyboard focus reverts main window.

this leads trouble - if undo cut, elements keyboard focus no longer on panel can't (for example) go cut-undo-cut-undo-cut.

what determines keyboard focus moves when element removed? tried making panel have isfocusscope="true" didn't seem have effect, , focus overview doesn't mention how control focus goes when element removed.

i guess best bet might setting focus manually after undo/redo (maybe encapsulating in behavior listens events focusmanager sends?)

see set focus on textbox in wpf


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -