Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 显示多个窗口-激活问题_Wpf_Windows_Notifications - Fatal编程技术网

Wpf 显示多个窗口-激活问题

Wpf 显示多个窗口-激活问题,wpf,windows,notifications,Wpf,Windows,Notifications,我正在编写一个小的通知组件,但是一次显示多个通知有问题。 我的警报/通知窗口继承自窗口类。Alert的contstructor看起来是这样的 public Alert() { InitializeComponent(); Focusable = true; ShowActivated = false; ShowInTaskbar = false; //To

我正在编写一个小的通知组件,但是一次显示多个通知有问题。 我的警报/通知窗口继承自窗口类。Alert的contstructor看起来是这样的

 public Alert()
        {

            InitializeComponent();

            Focusable = true;
            ShowActivated = false;
            ShowInTaskbar = false;
            //Topmost = true;
            AllowsTransparency = true;
            Opacity = 1;
            // Set up the fade in and fade out animations
            _Hint = "hint";
            Loaded += new RoutedEventHandler(DesktopAlertBase_Loaded);

        }

在应用程序的主窗口中,我有一个警报列表,由于这个列表,我知道在屏幕上放置警报的位置。如果我想显示一个警报,我会创建一个警报类的实例,然后使用show方法。显示警报,一切正常,但我只能使用/移动/与上次创建的警报窗口进行交互。其余警报窗口无法单击。然而,如果我关闭最后一个窗口,我可以在最后一个窗口之前使用一个窗口,依此类推。。。是否可以将多个窗口剪切/激活?

请提供代码,在哪里使用显示方法?看起来您使用的是ShowDialog方法而不是Show。 另一种可能是DesktopAlertBase_加载方法中存在一些锁