wpf - Simplify binding for non-standard button -
we using caliburn micro , it's pretty nice using new ribbon control (which comes .net 4.5). control has ribbonbutton , while button has click event , it's, well, button, seems caliburn doesn't auto fire action when it's name match viewmodel method one.
now, can fix using cal:message.attach="viewhelp" given pretty big amount of controls within ribbon bar wondering if there's easy way make auto binding work between ribbonbutton , viewmodel method.
you can use conventionmanager. start this:
conventionmanager.addelementconvention<ribbonbutton>( ribbonbutton.contentproperty, "datacontext", "click"); place code inside bootstrapper. this:
public class appbootstrapper : bootstrapper { protected override void configure() { conventionmanager.addelementconvention<ribbonbutton>( ribbonbutton.contentproperty, "datacontext", "click"); } } this not @ means should in bootstrapper. show right place.
Comments
Post a Comment