Any gotchas w/ Code-Behind (CB) and CM (caliburn micro) mixed together?

Feb 9, 2011 at 5:27 PM

I don't like to have CB, but often I run into one-offs that are just seemingly impossible to do in the view. For example, setting focus of a child-window, and 

then one of it's contained controls (textbox).  You can swing this in WPF in XAML, but not Silverlight.  I also don't want to use attached behaviors as an escape pod

every time.  I feel it's a little abusive for what they are supposed to be.

Ok, enough of the philosophical;

Are there gotchas with having a View, CB, and VM ?


I have already removed the call to InitializeComponent in my CB, to delegate that to CM.

From the docs,

Besides instantiation of your View, GetOrCreateViewType will call InitializeComponent on your View (if it exists)

Feb 9, 2011 at 7:49 PM

I am unaware of any gotchas.  Also, you don't need to remove the call to InitializeComponent. The internal implementation prevents it from intializing more than once.