Hey I want to make sure that I can only open ONE instance of this window, it doesn't seem to be working and not sure why.
I'm checking there is already a window open with the same name, and making sure im not detecting this current window attempting to open.
public new void Show()
{
//Ensure new notifications are placed above older ones
foreach (Window window in System.Windows.Application.Current.Windows)
{
string windowName = window.GetType().Name;
if (!windowName.Equals("NotificationAll") && window != this)
{
this.Topmost = true;
base.Show();
this.Owner = System.Windows.Application.Current.MainWindow;
//Position the Notification
var workingArea = SystemParameters.WorkArea;
this.Left = (workingArea.Width - this.ActualWidth) / 2;
this.Top = workingArea.Bottom - this.ActualHeight;
}
}
}
However more than one window is opening still!