Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs	(revision 2547)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs	(revision 2548)
@@ -42,21 +42,22 @@
     }
 
-    public override bool ShowView(IView view) {
-      if (InvokeRequired) return (bool)Invoke((Func<IView, bool>)ShowView, view);
+    protected override void Show(IView view, bool firstTimeShown) {
+      if (InvokeRequired) Invoke((Action<IView, bool>)Show, view, firstTimeShown);
       else {
-        bool ret = base.ShowView(view);
-        if (ret)
+        base.Show(view, firstTimeShown);
+        if (firstTimeShown)
           ((DockForm)GetForm(view)).Show(dockPanel);
         else
           ((DockForm)GetForm(view)).Activate();
-        return ret;
       }
     }
-    public override void HideView(IView view) {
+
+    protected override void Hide(IView view) {
       if (InvokeRequired) Invoke((Action<IView>)HideView, view);
       else {
         Form form = base.GetForm(view);
-        if (form != null)
+        if (form != null) {
           ((DockForm)form).Hide();
+        }
       }
     }
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainFormBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainFormBase.cs	(revision 2547)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainFormBase.cs	(revision 2548)
@@ -130,4 +130,28 @@
     }
 
+    public event EventHandler<ViewEventArgs> ViewClosed;
+    protected virtual void OnViewClosed(IView view) {
+      if (InvokeRequired) Invoke((Action<IView>)OnViewClosed, view);
+      else if (this.ViewClosed != null) {
+        this.ViewClosed(this, new ViewEventArgs(view));
+      }
+    }
+
+    public event EventHandler<ViewShownEventArgs> ViewShown;
+    protected virtual void OnViewShown(IView view, bool firstTimeShown) {
+      if (InvokeRequired) Invoke((Action<IView, bool>)OnViewShown, view, firstTimeShown);
+      else if (this.ViewShown != null) {
+        this.ViewShown(this, new ViewShownEventArgs(view, firstTimeShown));
+      }
+    }
+
+    public event EventHandler<ViewEventArgs> ViewHidden;
+    protected virtual void OnViewHidden(IView view) {
+      if (InvokeRequired) Invoke((Action<IView>)OnViewHidden, view);
+      else if (this.ViewHidden != null) {
+        this.ViewHidden(this, new ViewEventArgs(view));
+      }
+    }
+
     public event EventHandler Changed;
     public void FireMainFormChanged() {
@@ -145,6 +169,6 @@
     }
 
-    public virtual bool ShowView(IView view) {
-      if (InvokeRequired) return (bool)Invoke((Func<IView, bool>)ShowView, view);
+    public void ShowView(IView view) {
+      if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
       else {
         if (!views.Keys.Contains(view)) {
@@ -159,16 +183,27 @@
           foreach (IUserInterfaceItem item in UserInterfaceItems)
             view.Changed += new EventHandler(item.ViewChanged);
-          return true;
-        } else
-          return false;
-      }
-    }
-
-    public virtual void HideView(IView view) {
+          this.Show(view, true);
+          this.OnViewShown(view, true);
+        } else {
+          this.Show(view, false);
+          this.OnViewShown(view, false);
+        }
+      }
+    }
+
+    protected virtual void Show(IView view, bool firstTimeShown) {      
+    }
+
+    public void HideView(IView view) {
       if (InvokeRequired) Invoke((Action<IView>)HideView, view);
       else {
-        if (views.ContainsKey(view))
-          views[view].Hide();
-      }
+        if (this.views.ContainsKey(view)) {
+          this.Hide(view);
+          this.OnViewHidden(view);
+        }
+      }
+    }
+
+    protected virtual void Hide(IView view) {
     }
 
@@ -176,6 +211,8 @@
       if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
       else {
-        if (views.ContainsKey(view))
-          views[view].Close();
+        if (this.views.ContainsKey(view)) {
+          this.views[view].Close();
+          this.OnViewClosed(view);
+        }
       }
     }
@@ -184,7 +221,7 @@
       if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
       else {
-        if (views.ContainsKey(view)) {
+        if (this.views.ContainsKey(view)) {
           ((ViewBase)view).closeReason = closeReason;
-          views[view].Close();
+          this.CloseView(view);
         }
       }
@@ -198,5 +235,5 @@
     public virtual void CloseAllViews(CloseReason closeReason) {
       foreach (IView view in views.Keys.ToArray())
-        CloseView(view,closeReason);
+        CloseView(view, closeReason);
     }
     #endregion
@@ -217,4 +254,5 @@
 
       views.Remove(view);
+      this.OnViewClosed(view);
       if (ActiveView == view)
         ActiveView = null;
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs	(revision 2547)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs	(revision 2548)
@@ -48,15 +48,22 @@
     }
 
-    public override bool ShowView(IView view) {
-      if (InvokeRequired) return (bool)Invoke((Func<IView, bool>)ShowView, view);
+    protected override void Show(IView view, bool firstTimeShown) {
+      if (InvokeRequired) Invoke((Action<IView, bool>)Show, view, firstTimeShown);
       else {
-        bool ret = base.ShowView(view);
-        if (ret)
-          GetForm(view).Show();
+        base.Show(view, firstTimeShown);
+        if (firstTimeShown)
+          GetForm(view).Show(this);
         else {
           GetForm(view).Visible = true;
           GetForm(view).Activate();
         }
-        return ret;
+      }
+    }
+
+    protected override void Hide(IView view) {
+      if (InvokeRequired) Invoke((Action<IView>)Hide, view);
+      else {
+        base.Hide(view);
+        this.GetForm(view).Hide();
       }
     }
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs	(revision 2547)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs	(revision 2548)
@@ -42,9 +42,9 @@
     }
 
-    public override bool ShowView(IView view) {
-      if (InvokeRequired) return (bool)Invoke((Func<IView, bool>)ShowView, view);
+    protected override void Show(IView view, bool firstTimeShown) {
+      if (InvokeRequired) Invoke((Action<IView, bool>)Show, view, firstTimeShown);
       else {
-        bool ret = base.ShowView(view);
-        if (ret)
+        base.Show(view, firstTimeShown);
+        if (firstTimeShown)
           GetForm(view).Show(this);
         else {
@@ -52,5 +52,12 @@
           GetForm(view).Activate();
         }
-        return ret;
+      }
+    }
+
+    protected override void Hide(IView view) {
+      if (InvokeRequired) Invoke((Action<IView>)Hide, view);
+      else {
+        base.Hide(view);
+        this.GetForm(view).Hide();
       }
     }
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewBase.cs	(revision 2547)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewBase.cs	(revision 2548)
@@ -42,7 +42,12 @@
       get { return myCaption; }
       set {
-        if (value != myCaption) {
-          myCaption = value;
-          OnCaptionChanged();
+        if (InvokeRequired) {
+          Action<string> action = delegate(string s) { this.Caption = s; };
+          Invoke(action, value);
+        } else {
+          if (value != myCaption) {
+            myCaption = value;
+            OnCaptionChanged();
+          }
         }
       }
@@ -57,9 +62,11 @@
     public event EventHandler Changed;
     protected virtual void OnChanged() {
-      if (Changed != null)
+      if (InvokeRequired)
+        Invoke((MethodInvoker)OnChanged);
+      else if (Changed != null)
         Changed(this, new EventArgs());
     }
 
-    public virtual void OnClosing(object sender, CancelEventArgs e) {     
+    public virtual void OnClosing(object sender, CancelEventArgs e) {
     }
 
@@ -67,12 +74,12 @@
     internal void OnClosingHelper(object sender, FormClosingEventArgs e) {
       if (this.closeReason != CloseReason.None)
-        this.OnClosing(sender, new FormClosingEventArgs(this.closeReason,e.Cancel));
+        this.OnClosing(sender, new FormClosingEventArgs(this.closeReason, e.Cancel));
       else
         this.OnClosing(sender, e);
-      
+
       this.closeReason = CloseReason.None;
     }
 
-    public virtual void OnClosing(object sender, FormClosingEventArgs e) {      
+    public virtual void OnClosing(object sender, FormClosingEventArgs e) {
     }
 
Index: /trunk/sources/HeuristicLab.MainForm/3.2/HeuristicLab.MainForm-3.2.csproj
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/HeuristicLab.MainForm-3.2.csproj	(revision 2547)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/HeuristicLab.MainForm-3.2.csproj	(revision 2548)
@@ -81,4 +81,6 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="ViewShownEventArgs.cs" />
+    <Compile Include="ViewEventArgs.cs" />
     <Compile Include="ToolBarSeparatorItemBase.cs" />
     <Compile Include="Interfaces\IToolBarSeparatorItem.cs" />
Index: /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IMainForm.cs	(revision 2547)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IMainForm.cs	(revision 2548)
@@ -31,10 +31,15 @@
 
     IView ActiveView { get; }
+    IEnumerable<IView> Views { get; }
+
     event EventHandler ActiveViewChanged;
     event EventHandler Changed;
-    IEnumerable<IView> Views { get; }
+    
+    event EventHandler<ViewEventArgs> ViewClosed;
+    event EventHandler<ViewShownEventArgs> ViewShown;
+    event EventHandler<ViewEventArgs> ViewHidden;
 
     Type UserInterfaceItemType { get; }
-    bool ShowView(IView view);  //return value indicates if a new form for the view is created
+    void ShowView(IView view); 
     void HideView(IView view);
     void CloseView(IView view);
Index: /trunk/sources/HeuristicLab.MainForm/3.2/ViewEventArgs.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/ViewEventArgs.cs	(revision 2548)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/ViewEventArgs.cs	(revision 2548)
@@ -0,0 +1,39 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.MainForm {
+  public class ViewEventArgs : EventArgs {
+    public ViewEventArgs(IView view)
+      : base() {
+      this.view = view;
+    }
+
+    private IView view;
+    public IView View {
+      get { return this.view; }
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.MainForm/3.2/ViewShownEventArgs.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/ViewShownEventArgs.cs	(revision 2548)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/ViewShownEventArgs.cs	(revision 2548)
@@ -0,0 +1,39 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace HeuristicLab.MainForm {
+  public class ViewShownEventArgs : ViewEventArgs {
+    public ViewShownEventArgs(IView view, bool firstTimeShown)
+      : base(view) {
+      this.firstTimeShown = firstTimeShown;
+    }
+
+    private bool firstTimeShown;
+    public bool  FirstTimeShown {
+      get { return this.firstTimeShown; }
+    }
+  }
+}
