I try to avoid code behind in views, within my WPF MVVM project.
However I have some things that are very specific to the view. For example when a control gets focus
Using Custom controls as @Boluc Papuccuoglu suggested, is good option but before using that i want you to take look here Behaviors in WPF introduction
@Boluc Papuccuoglu