c# - Caliburn Micro WPF: Message.Attach with guard property disables whole host control -


i'm using caliburn.micro (2.0.2, latest version) wpf application. have simple list of items, , want enable action on selected item. action bound button.

so, vm exposes bindable collection of items (e.g. persons), , object of same type bound selected item (e.g. selectedperson). action corresponds method named test, , have guard property cantest, returns true when selected item not null. when selectedperson changes, call notifyofpropertychanged cantest.

this trivial scenario works fine: when nothing selected button corresponding action disabled; when select item, gets enabled.

the issue arises when bind method control event, using message.attach: want attach mouse double click. xaml this:

<listbox itemssource="{binding path=persons,mode=oneway}"          selecteditem="{binding path=selectedperson,mode=twoway}"          cal:message.attach="[event mousedoubleclick] = [action test]"/> 

this totally disables control (the whole control, not descendant button, can never select item in listbox, stays disabled forever). way have enable remove guard property vm (or message.attach view).

you can find simple repro @ http://1drv.ms/1otsgq2.

i found post @ https://caliburnmicro.codeplex.com/discussions/246571, seems suggest attaching message disables convention-based logic guard properties, have explicitly bind isenabled property of control guard property. tried this, nothing changes.

because of caliburn's conventions, in case suggest merely change property name of cantest istestenabled.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -