Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

New Post: Using Message.Attach in code instead of Xaml

$
0
0
Typically, I create the View in xaml, and bind Events to the ViewModel using Caliburn.Micro.
<Button cal:Message.Attach="[MouseLeftButtonUp]=[ModifyList($source)]" />
However, I now need to create the button in code, based on configuration data.

The code is not in the CodeBehind, it's in a Factory class.
Button button = new Button(){Content = "Click Me"};
So the question is how to wire up the event in code instead of Xaml?

Greg

Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>