private void NotificationWindowSizeChanged(object sender, SizeChangedEventArgs e) { if (e.NewSize.Height != 0.0) { return; } var element = sender as Grid; RemoveNotification(Notifications.First(n => n.Id == Int32.Parse(element.Tag.ToString()))); }