Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs	(revision 3402)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs	(revision 3403)
@@ -45,8 +45,8 @@
     }
 
-    protected override void Show(IView view, bool firstTimeShown) {
-      if (InvokeRequired) Invoke((Action<IView, bool>)Show, view, firstTimeShown);
+    protected override void ShowView(IView view, bool firstTimeShown) {
+      if (InvokeRequired) Invoke((Action<IView, bool>)ShowView, view, firstTimeShown);
       else {
-        base.Show(view, firstTimeShown);
+        base.ShowView(view, firstTimeShown);
         if (firstTimeShown)
           ((DockForm)GetForm(view)).Show(dockPanel);
@@ -59,5 +59,5 @@
       if (InvokeRequired) Invoke((Action<IView>)HideView, view);
       else {
-        Form form = base.GetForm(view);
+        Form form = this.GetForm(view);
         if (form != null) {
           ((DockForm)form).Hide();
@@ -72,6 +72,9 @@
         ViewHost viewHost = new ViewHost(contentView);
         form = new DockForm(viewHost);
-      } else
+        this.AddViewFormCombination(viewHost, form);
+      } else {
         form = new DockForm(view);
+        this.AddViewFormCombination(view, form);
+      }
       return form;
     }
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainForm.cs	(revision 3402)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainForm.cs	(revision 3403)
@@ -89,4 +89,8 @@
       get { return views.Keys; }
     }
+    protected void AddViewFormCombination(IView view, Form form) {
+      this.views.Add(view, form);
+      view.Changed += new EventHandler(ViewChanged);
+    }
 
     private IView activeView;
@@ -124,6 +128,8 @@
     protected virtual void OnViewClosed(IView view) {
       if (InvokeRequired) Invoke((Action<IView>)OnViewClosed, view);
-      else if (this.ViewClosed != null) {
-        this.ViewClosed(this, new ViewEventArgs(view));
+      else {
+        EventHandler<ViewEventArgs> handler = ViewClosed;
+        if (handler != null)
+          handler(this, new ViewEventArgs(view));
       }
     }
@@ -132,6 +138,8 @@
     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));
+      else {
+        EventHandler<ViewShownEventArgs> handler = ViewShown;
+        if (handler != null)
+          handler(this, new ViewShownEventArgs(view, firstTimeShown));
       }
     }
@@ -140,6 +148,8 @@
     protected virtual void OnViewHidden(IView view) {
       if (InvokeRequired) Invoke((Action<IView>)OnViewHidden, view);
-      else if (this.ViewHidden != null) {
-        this.ViewHidden(this, new ViewEventArgs(view));
+      else {
+        EventHandler<ViewEventArgs> handler = ViewHidden;
+        if (handler != null)
+          handler(this, new ViewEventArgs(view));
       }
     }
@@ -149,6 +159,9 @@
       if (InvokeRequired)
         Invoke((MethodInvoker)FireMainFormChanged);
-      else if (Changed != null)
-        Changed(this, EventArgs.Empty);
+      else {
+        EventHandler handler = Changed;
+        if (handler != null)
+          Changed(this, EventArgs.Empty);
+      }
     }
 
@@ -172,5 +185,5 @@
 
     protected override void OnFormClosing(FormClosingEventArgs e) {
-      foreach (KeyValuePair<IView,Form > pair in this.views) {
+      foreach (KeyValuePair<IView, Form> pair in this.views) {
         DockForm dockForm = pair.Value as DockForm;
         View view = pair.Key as View;
@@ -203,26 +216,36 @@
 
     internal Form GetForm(IView view) {
-      if (views.ContainsKey(view))
-        return views[view];
+      IView internalView = GetView(view);
+      if (internalView != null && views.ContainsKey(internalView))
+        return views[internalView];
       return null;
     }
-
-    internal IView GetView(Form form) {
+    protected IView GetView(Form form) {
       return views.Where(x => x.Value == form).Single().Key;
     }
-
-    internal void ShowView(IView view, bool firstTimeShown) {
-      if (InvokeRequired) Invoke((Action<IView, bool>)ShowView, view, firstTimeShown);
-      else {
-        if (firstTimeShown) {
-          Form form = CreateForm(view);
-          view.Changed += new EventHandler(ViewChanged);
-          this.views[view] = form;
+    private IView GetView(IView view) {
+      if (view == null || views.ContainsKey(view))
+        return view;
+      IView viewHost =
+        (from ViewHost v in views.Keys.OfType<ViewHost>()
+         where v.Views.Contains(((IContentView)view))
+         select v).SingleOrDefault();
+      return viewHost;
+    }
+
+
+    internal void ShowView(IView view) {
+      if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
+      else {
+        Form form = GetForm(view);
+        bool firstTimeShown = form == null;
+        if (form == null) {
+          form = CreateForm(view);
           form.Activated += new EventHandler(FormActivated);
           form.FormClosed += new FormClosedEventHandler(ChildFormClosed);
-
-        }
-        this.Show(view, firstTimeShown);
-        this.OnViewShown(view, firstTimeShown);
+        }
+        IView internalView = GetView(form);
+        this.ShowView(internalView, firstTimeShown);
+        this.OnViewShown(internalView, firstTimeShown);
       }
     }
@@ -234,5 +257,5 @@
     }
 
-    protected virtual void Show(IView view, bool firstTimeShown) {
+    protected virtual void ShowView(IView view, bool firstTimeShown) {
     }
 
@@ -240,9 +263,10 @@
       if (InvokeRequired) Invoke((Action<IView>)HideView, view);
       else {
-        if (this.views.ContainsKey(view)) {
-          this.Hide(view);
-          if (this.activeView == view)
+        IView internalView = this.GetView(view);
+        if (internalView != null && this.views.ContainsKey(internalView)) {
+          this.Hide(internalView);
+          if (this.activeView == internalView)
             this.ActiveView = null;
-          this.OnViewHidden(view);
+          this.OnViewHidden(internalView);
         }
       }
@@ -269,7 +293,8 @@
       if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
       else {
-        if (this.views.ContainsKey(view)) {
-          this.views[view].Close();
-          this.OnViewClosed(view);
+        IView internalView = GetView(view);
+        if (internalView != null && this.views.ContainsKey(internalView)) {
+          this.views[internalView].Close();
+          this.OnViewClosed(internalView);
         }
       }
@@ -279,7 +304,8 @@
       if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
       else {
-        if (this.views.ContainsKey(view)) {
-          ((View)view).CloseReason = closeReason;
-          this.CloseView(view);
+        IView internalView = GetView(view);
+        if (internalView != null && this.views.ContainsKey(internalView)) {
+          ((View)internalView).CloseReason = closeReason;
+          this.CloseView(internalView);
         }
       }
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs	(revision 3402)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs	(revision 3403)
@@ -51,8 +51,8 @@
     }
 
-    protected override void Show(IView view, bool firstTimeShown) {
-      if (InvokeRequired) Invoke((Action<IView, bool>)Show, view, firstTimeShown);
+    protected override void ShowView(IView view, bool firstTimeShown) {
+      if (InvokeRequired) Invoke((Action<IView, bool>)ShowView, view, firstTimeShown);
       else {
-        base.Show(view, firstTimeShown);
+        base.ShowView(view, firstTimeShown);
         if (firstTimeShown)
           this.GetForm(view).Show();
@@ -68,5 +68,8 @@
       else {
         base.Hide(view);
-        this.GetForm(view).Hide();
+        Form form = this.GetForm(view);
+        if (form != null) {
+          form.Hide();
+        }
       }
     }
@@ -78,6 +81,9 @@
         ViewHost viewHost = new ViewHost(contentView);
         form = new DocumentForm(viewHost);
-      } else
+        this.AddViewFormCombination(viewHost, form);
+      } else {
         form = new DocumentForm(view);
+        this.AddViewFormCombination(view, form);
+      }
 
       form.MdiParent = this;
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs	(revision 3402)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs	(revision 3403)
@@ -45,8 +45,8 @@
     }
 
-    protected override void Show(IView view, bool firstTimeShown) {
-      if (InvokeRequired) Invoke((Action<IView, bool>)Show, view, firstTimeShown);
+    protected override void ShowView(IView view, bool firstTimeShown) {
+      if (InvokeRequired) Invoke((Action<IView, bool>)ShowView, view, firstTimeShown);
       else {
-        base.Show(view, firstTimeShown);
+        base.ShowView(view, firstTimeShown);
         if (firstTimeShown)
           this.GetForm(view).Show(this);
@@ -62,5 +62,8 @@
       else {
         base.Hide(view);
-        this.GetForm(view).Hide();
+        Form form = this.GetForm(view);
+        if (form != null) {
+          form.Hide();
+        }
       }
     }
@@ -72,6 +75,9 @@
         ViewHost viewHost = new ViewHost(contentView);
         form = new DocumentForm(viewHost);
-      } else
+        this.AddViewFormCombination(viewHost, form);
+      } else {
         form = new DocumentForm(view);
+        this.AddViewFormCombination(view, form);
+      }
 
       form.ShowInTaskbar = true;
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/View.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/View.cs	(revision 3402)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/View.cs	(revision 3403)
@@ -82,5 +82,5 @@
 
       this.IsShown = true;
-      mainform.ShowView(this, firstTimeShown);
+      mainform.ShowView(this);
       if (firstTimeShown) {
         Form form = mainform.GetForm(this);
@@ -146,8 +146,8 @@
     }
 
-    protected virtual void OnShown(ViewShownEventArgs e) {
-    }
-
-    protected virtual void OnHidden(EventArgs e) {
+    internal protected virtual void OnShown(ViewShownEventArgs e) {
+    }
+
+    internal protected virtual void OnHidden(EventArgs e) {
     }
 
@@ -170,5 +170,5 @@
     }
 
-    protected virtual void OnClosing(FormClosingEventArgs e) {
+    internal protected virtual void OnClosing(FormClosingEventArgs e) {
     }
 
@@ -185,5 +185,5 @@
     }
 
-    protected virtual void OnClosed(FormClosedEventArgs e) {
+    internal protected virtual void OnClosed(FormClosedEventArgs e) {
     }
 
@@ -215,7 +215,7 @@
     public void ResumeRepaint(bool refresh) {
       if (InvokeRequired)
-        Invoke((Action<bool>)ResumeRepaint,refresh);
-      else
-      ((Control)this).ResumeRepaint(refresh);
+        Invoke((Action<bool>)ResumeRepaint, refresh);
+      else
+        ((Control)this).ResumeRepaint(refresh);
     }
   }
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.Designer.cs	(revision 3402)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.Designer.cs	(revision 3403)
@@ -84,5 +84,5 @@
       this.viewsLabel.TabIndex = 0;
       this.toolTip.SetToolTip(this.viewsLabel, "Double-click to open a new window of the current view.\r\nRight-click to change cur" +
-              "rent view.");
+              "rent view. \r\n Drag icon to copy or link content in another view.");
       this.viewsLabel.MouseLeave += new System.EventHandler(this.viewsLabel_MouseLeave);
       this.viewsLabel.DoubleClick += new System.EventHandler(this.viewsLabel_DoubleClick);
Index: /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.cs	(revision 3402)
+++ /trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.cs	(revision 3403)
@@ -29,5 +29,4 @@
   [Content(typeof(object))]
   public sealed partial class ViewHost : AsynchronousContentView {
-    private Dictionary<Type, IContentView> cachedViews;
     public ViewHost() {
       InitializeComponent();
@@ -37,4 +36,5 @@
       startDragAndDrop = false;
       viewContextMenuStrip.IgnoredViewTypes = new List<Type>() { typeof(ViewHost) };
+      activeView = null;
     }
     public ViewHost(object content)
@@ -43,11 +43,43 @@
     }
 
-    public ViewHost(IContentView contentView) :this(){
+    public ViewHost(IContentView contentView)
+      : this() {
       this.viewType = contentView.GetType();
       this.Content = contentView.Content;
       this.cachedViews.Add(contentView.GetType(), contentView);
-      this.UpdateView();
-    }
-
+      this.activeView = contentView;
+      this.RegisterActiveViewEvents();
+      this.OnViewTypeChanged();
+      this.ActiveViewChanged();
+    }
+
+    private Dictionary<Type, IContentView> cachedViews;
+    public IEnumerable<IContentView> Views {
+      get { return cachedViews.Values; }
+    }
+
+    private IContentView activeView;
+    public IContentView ActiveView {
+      get { return this.activeView; }
+      private set {
+        if (activeView != value) {
+          if (activeView != null) {
+            DeregisterActiveViewEvents();
+            View view = activeView as View;
+            if (view != null)
+              view.OnHidden(EventArgs.Empty);
+          }
+          activeView = value;
+          if (activeView != null) {
+            RegisterActiveViewEvents();
+            View view = activeView as View;
+            if (view != null)
+              view.OnShown(new ViewShownEventArgs(view,false));
+          }
+          ActiveViewChanged();
+          OnViewTypeChanged();
+        }
+      }
+    }
     private Type viewType;
     public Type ViewType {
@@ -59,9 +91,8 @@
                                                       value, Content.GetType()));
           viewType = value;
-          UpdateView();
-        }
-      }
-    }
-
+          OnViewTypeChanged();
+        }
+      }
+    }
     public new object Content {
       get { return base.Content; }
@@ -107,4 +138,5 @@
             ViewType = (Type)viewContextMenuStrip.Items[0].Tag;
         }
+
         foreach (IContentView view in cachedViews.Values)
           view.Content = this.Content;
@@ -117,10 +149,8 @@
 
 
-    private void UpdateView() {
+    private void OnViewTypeChanged() {
       viewPanel.Controls.Clear();
-
       if (viewType == null || Content == null)
         return;
-
       if (!ViewCanShowContent(viewType, Content))
         throw new InvalidOperationException(string.Format("View \"{0}\" cannot display content \"{1}\".",
@@ -135,6 +165,5 @@
         cachedViews.Add(viewType, view);
       }
-      this.Caption = view.Caption;
-      this.SaveEnabled = view.SaveEnabled;
+      this.ActiveView = view;
 
       Control control = (Control)view;
@@ -144,4 +173,56 @@
     }
 
+
+
+    private void RegisterActiveViewEvents() {
+      activeView.Changed += new EventHandler(activeView_Changed);
+      activeView.CaptionChanged += new EventHandler(activeView_CaptionChanged);
+    }
+    private void DeregisterActiveViewEvents() {
+      activeView.Changed -= new EventHandler(activeView_Changed);
+      activeView.CaptionChanged -= new EventHandler(activeView_CaptionChanged);
+    }
+    private void activeView_CaptionChanged(object sender, EventArgs e) {
+      this.ActiveViewChanged();
+    }
+    private void activeView_Changed(object sender, EventArgs e) {
+      this.ActiveViewChanged();
+    }
+    private void ActiveViewChanged() {
+      if (ActiveView != null) {
+        this.Caption = this.ActiveView.Caption;
+        this.SaveEnabled = this.ActiveView.SaveEnabled;
+      }
+    }
+
+    #region forwarding of view events
+    internal protected override void OnShown(ViewShownEventArgs e) {
+      base.OnShown(e);
+      View view = this.ActiveView as View;
+      if (view != null)
+        view.OnShown(e);
+    }
+
+    internal protected override void OnHidden(EventArgs e) {
+      base.OnHidden(e);
+      View view = this.ActiveView as View;
+      if (view != null)
+        view.OnHidden(e);
+    }
+
+    internal protected override void OnClosing(FormClosingEventArgs e) {
+      base.OnClosing(e);
+      foreach (View view in this.Views.OfType<View>())
+        view.OnClosing(e);
+    }
+
+    internal protected override void OnClosed(FormClosedEventArgs e) {
+      base.OnClosed(e);
+      foreach (View view in this.Views.OfType<View>())
+        view.OnClosed(e);
+    }
+    #endregion
+
+    #region GUI actions
     private void UpdateActiveMenuItem() {
       foreach (KeyValuePair<Type, ToolStripMenuItem> item in viewContextMenuStrip.MenuItems) {
@@ -167,5 +248,4 @@
       MainFormManager.CreateView(viewType, Content, ReadOnly).Show();
     }
-
     private void viewContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e) {
       Type viewType = (Type)e.ClickedItem.Tag;
@@ -178,5 +258,4 @@
       viewsLabel.Capture = false;
     }
-
     private void viewsLabel_MouseLeave(object sender, EventArgs e) {
       if ((Control.MouseButtons & MouseButtons.Left) == MouseButtons.Left && startDragAndDrop) {
@@ -188,4 +267,5 @@
         startDragAndDrop = false;
     }
+    #endregion
   }
 }
