at the moment I’m working on some focus problems at our main application.
Here we use Hydra a lot to mix Delphi and .Net dialogs.
And I think I found a problem with hydra. I’m not really sure if it is hydra wich is causing the problem but at the moment it looks like.
To test this I used the VisualizerHost project at the delphi samples and added another Button to it which simply opens a Window with only one VisualPlugin inside.
<hydra:VisualPlugin x:Class="Visualizer.TestView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hydra="clr-namespace:RemObjects.Hydra.WPF;assembly=RemObjects.Hydra.WPF" Height="300" Width="300" > <ContentControl> <Rectangle Fill="GreenYellow"></Rectangle> </ContentControl>
And I created a new WPF-Application with a red rectangle in it.
<Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp1" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <Rectangle Fill="Red"></Rectangle> </Grid>
If I open the delphi app and the green window and close it everything is working fine.
But if I open the green window switch to the red one, back to the green one and close it then the red one comes infront of the delphi app.
Here is a video:
As additional info this happens only when the green rectangle is inside a ContentControl. So the problem is the ContentControl or any descedant (Frame in my main app).
And the second app (red window) has to be an WPF app. Otherwise it doesn’t work for me.
Can you please have a look at it and maybe fix it if it’s a bug?