'Handling a framework-specific event and MVVM?

In a WPF application that uses Prism, I have a shell in which there is a docking manager control.

Now I have to listen to an event coming from that docking manager, specifically, when one of its children docking state has changed.

To me, this event should be handled in code-behind as letting the view model do some work against that framework-specific visual control is worse than doing it code-behind.

Question:

Is this the right approach or am I missing something?



Solution 1:[1]

As long as the code is only related for the presentation then it is no problem to have it in "code-behind".

The main problem with "code-behind" is having the presentation logic split in two different locations XAML and "code-behind". There are several ways to avoid that using MarkupExtension, DependencyProperty, ValueConverter or custom (derived) controls.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sir Rufo