I've read plenty of articles around different patterns in use with WPF and this is something I've yet to understand: should a code-behind file be considered part of the view? As a consequence, should code-behind files be allowed utilise knowledge of specific elements in the markup?
I have a number of scenarios where the controls which are present in a view are influenced by data in the view model (eg a button for each list item). Currently, I handle these kinds of scenarios in the relevant code-behind file. To me, this feels like an implementation detail of the view and thus part of it; another view of the same view model might choose a list box of list items for example).