So basically, the MainWindow opens a second Window, let's say OptionsWindow. So in the OptionsWindow I want to show a visual of the MainWindow. I tried this, but didn't work:
<Rectangle Grid.Row="1" Margin="3" Height="100">
<Rectangle.Fill>
<VisualBrush Visual="{Binding Application.Current.MainWindow}" />
</Rectangle.Fill>
</Rectangle>
Any help greatly appreciated.
EDIT:
I found the obvious answer:
windowPreview.Visual = Application.Current.MainWindow;
The only weird thing is that it calls the Loaded event of the MainWindow again and I have some code there that should only run when the MainWindow first loads. I though it would just show the current instance of the MainWindow. Any workaround on this?