Well I tried and here is my code for this:
XAML File looks like that:
<Window x:Class="WpfApplication2.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" MouseEnter="Window_MouseEnter">
<Grid>
<Popup x:Name="PopupTest" AllowsTransparency="True" Opened="PopupTest_Opened" MouseDown="PopupTest_MouseDown">
<Viewbox VerticalAlignment="Top">
<TextBlock Text="WWW">
</TextBlock>
</Viewbox>
</Popup>
</Grid>
</Window>
And the cs file is the following:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Win32;
namespace WpfApplication2
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void Window_MouseEnter(object sender, MouseEventArgs e)
{
PopupTest.Placement = System.Windows.Controls.Primitives.PlacementMode.Mouse;
PopupTest.StaysOpen = false;
PopupTest.Height = 1000;
PopupTest.Width = 500;
PopupTest.IsOpen = true;
}
private void PopupTest_Opened(object sender, EventArgs e)
{
}
private void PopupTest_MouseDown(object sender, MouseButtonEventArgs e)
{
var dialog = new OpenFileDialog();
dialog.ShowDialog();
}
}
}
And the openfiledialog is displayed in the foreground :-).