I have a wpf application that needs to pop up in front all other windows based on certain conditions. I am trying to accomplish this in an MVVM compliant manner. After a lot of research, the best solution involves using the window's activate event and interface's behavior. I was able to get the activate function to work using the second solution found on mvvm activate . However, once I style my GUI using Mahapp Metro control "MetroWindow" based on the quickstart guide, the GUI messes up. Whenever the XAML interaction behavior section is added, the GUI's original Window object appears, resulting with 2 title bars (one from Window and other from MetroWindow). I tried designing my own window using Metro stylings but so far unable to implement the Metro title bar (can't find any guides or documentation on doing so). Visual studio also keeps complaining "Object reference not set to an instance of an object" (sometimes on
<controls:MetroWindow
...
and other times on
<i:Interaction.Behaviors>
<Behaviors:ActivateBehavior ...
yet the application runs.
How do I keep the Mahapps Metro styles (including title bar style) and cause the window to appear in front as determined by my business logic in an MVVM compliant manner?