WPF - Mirroring content to another window
-
Hello everyone, For small research project of my AI programme, I'm building a visualization for a multi-screen application, and 2 zones of which must be mirrored. So basically: - On one side I have a WPF layout with controls, data, images and animations happeling - This content should be replicated on another screen (simply another Window) Do you have any ideas how to achieve this? Something that could grab a frame and replicate it, like a texture brush maybe? Thank you in advance for your answers! Best regards, Kel
-- Everything is possible, even the impossible! ^_^
-
Hello everyone, For small research project of my AI programme, I'm building a visualization for a multi-screen application, and 2 zones of which must be mirrored. So basically: - On one side I have a WPF layout with controls, data, images and animations happeling - This content should be replicated on another screen (simply another Window) Do you have any ideas how to achieve this? Something that could grab a frame and replicate it, like a texture brush maybe? Thank you in advance for your answers! Best regards, Kel
-- Everything is possible, even the impossible! ^_^
Use a VisualBrush.
-
Use a VisualBrush.
Thank you for your reply! Ok so I figured out how to do the mirroring within same Window, something like this:
<Canvas x:Name="RendererCanvas" Background="White" Grid.Column="1" Grid.Row="1" >
<v:RenderView x:Name="Renderer" Width="300" Height="300" />
</Canvas><Grid Grid.Column="0" Grid.Row="1" Background="DarkGray"> <Viewbox Stretch="Uniform" DataContext="{Binding ElementName=Renderer}"> <Grid Width="{Binding Width}" Height="{Binding Height}"> <Grid.Background> <VisualBrush Stretch="Uniform" Visual="{Binding}" /> </Grid.Background> </Grid> </Viewbox> </Grid>
Now, would it be possible to do exact same thing but in 2 different windows? So 2 XAML files one binding another. Maybe with some static fields?
-- Just think in 10 dimensions!