Index: /trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/SaveToolStripButtonItem.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/SaveToolStripButtonItem.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/SaveToolStripButtonItem.cs	(revision 2254)
@@ -21,4 +21,24 @@
       new SaveAction().Execute(mainform);
     }
+
+    public override bool ListenActiveViewChanged {
+      get { return true; }
+    }
+
+    public override void ActiveViewChanged(object sender, EventArgs e) {
+      IMainForm mainform = (IMainForm)sender;
+      if (mainform.ActiveView == null)
+        this.ToolStripItem.Enabled = false;
+      else
+        this.ToolStripItem.Enabled = !(mainform.ActiveView is FormView);
+    }
+
+    public override bool ListenViewStateChanged {
+      get { return true; }
+    }
+
+    public override void ViewStateChanged(object sender, EventArgs e) {
+      this.ToolStripItem.Enabled = !this.ToolStripItem.Enabled;
+    }
   }
 }
Index: /trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.Designer.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.Designer.cs	(revision 2254)
@@ -25,4 +25,5 @@
     private void InitializeComponent() {
       this.label1 = new System.Windows.Forms.Label();
+      this.ChangeStateButton = new System.Windows.Forms.Button();
       this.SuspendLayout();
       // 
@@ -37,8 +38,19 @@
       this.label1.Text = "EditorForm";
       // 
+      // ChangeStateButton
+      // 
+      this.ChangeStateButton.Location = new System.Drawing.Point(34, 100);
+      this.ChangeStateButton.Name = "ChangeStateButton";
+      this.ChangeStateButton.Size = new System.Drawing.Size(75, 23);
+      this.ChangeStateButton.TabIndex = 1;
+      this.ChangeStateButton.Text = "ChangeState";
+      this.ChangeStateButton.UseVisualStyleBackColor = true;
+      this.ChangeStateButton.Click += new System.EventHandler(this.ChangeStateButton_Click);
+      // 
       // EditorView
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.ChangeStateButton);
       this.Controls.Add(this.label1);
       this.ForeColor = System.Drawing.SystemColors.ControlText;
@@ -52,4 +64,5 @@
 
     private System.Windows.Forms.Label label1;
+    private System.Windows.Forms.Button ChangeStateButton;
   }
 }
Index: /trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.cs	(revision 2254)
@@ -17,4 +17,8 @@
       : base(mainform) {
     }
+
+    private void ChangeStateButton_Click(object sender, EventArgs e) {
+      this.OnStateChanged();
+    }
   }
 }
Index: /trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/ExitToolStripMenuItem.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/ExitToolStripMenuItem.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm.Test/3.2/MenuItems/ExitToolStripMenuItem.cs	(revision 2254)
@@ -23,5 +23,5 @@
 
     public override void Execute(IMainForm mainform) {
-      mainform.Close();
+      mainform.CloseForm();
     }
   }
Index: /trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs	(revision 2254)
@@ -44,6 +44,5 @@
     private DockPanel dockPanel;
 
-    public override void ShowView(IView view) {
-      
+    public override void ShowView(IView view) {      
       if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
       else {
@@ -52,4 +51,6 @@
         content.Activated += new EventHandler(DockFormActivated);
         content.FormClosing += new FormClosingEventHandler(DockFormClosing);
+        foreach (IToolStripItem item in viewStateChangeToolStripItems)
+          view.StateChanged += new EventHandler(item.ViewStateChanged);
         content.Show(dockPanel);
       }
@@ -60,11 +61,13 @@
       openViews.Remove(dockForm.View);
       if (openViews.Count == 0)
-        activeView = null;
+        ActiveView = null;
       dockForm.Activated -= new EventHandler(DockFormActivated);
       dockForm.FormClosing -= new FormClosingEventHandler(DockFormClosing);
+      foreach (IToolStripItem item in viewStateChangeToolStripItems)
+        dockForm.View.StateChanged -= new EventHandler(item.ViewStateChanged);
     }
 
     private void DockFormActivated(object sender, EventArgs e) {
-      base.activeView = ((DockForm)sender).View;
+      base.ActiveView = ((DockForm)sender).View;
       base.StatusStripText = ((DockForm)sender).View.Caption;
     }
Index: /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IMainForm.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IMainForm.cs	(revision 2254)
@@ -33,10 +33,10 @@
 
     IView ActiveView { get; }
+    event EventHandler ActiveViewChanged;
     IEnumerable<IView> OpenViews { get; }
 
     Type UserInterfaceItemType { get; }
     void ShowView(IView view);
-
-    void Close();
+    void CloseForm();
   }
 }
Index: /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IToolStripItem.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IToolStripItem.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IToolStripItem.cs	(revision 2254)
@@ -37,4 +37,9 @@
 
     ToolStripItem ToolStripItem { get; set; }
+
+    bool ListenActiveViewChanged { get; }
+    bool ListenViewStateChanged { get; }
+    void ActiveViewChanged(object sender, EventArgs e);
+    void ViewStateChanged(object sender, EventArgs e);
   }
 }
Index: /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IView.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IView.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IView.cs	(revision 2254)
@@ -28,4 +28,5 @@
     string Caption { get; set; }
     event EventHandler CaptionChanged;
+    event EventHandler StateChanged;
     IMainForm MainForm { get; set; }
   }
Index: /trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs	(revision 2254)
@@ -37,6 +37,8 @@
       InitializeComponent();
       openViews = new List<IView>();
+      viewStateChangeToolStripItems = new List<IToolStripItem>();
       this.userInterfaceItemType = userInterfaceItemType;
       CreateGUI();
+      OnActiveViewChanged();
     }
 
@@ -57,7 +59,21 @@
     }
 
-    protected IView activeView;
+    private IView activeView;
     public IView ActiveView {
       get { return this.activeView; }
+      protected set {
+        if (this.activeView != value) {
+          this.activeView = value;
+          OnActiveViewChanged();
+        }
+      }
+    }
+
+    protected List<IToolStripItem> viewStateChangeToolStripItems;
+
+    public event EventHandler ActiveViewChanged;
+    protected virtual void OnActiveViewChanged() {
+      if(ActiveViewChanged != null)
+        ActiveViewChanged(this,new EventArgs());
     }
 
@@ -68,11 +84,11 @@
 
     public virtual void ShowView(IView view) {
-      view.MainForm = this;
-      activeView = view;
+      view.MainForm = this;     
       openViews.Add(view);
+      ActiveView = view;
     }
 
-    public void Close() {
-      ((Form)this).Close();
+    public void CloseForm() {
+      this.Close();
     }
     #endregion
@@ -94,5 +110,5 @@
       foreach (IToolStripButtonItem toolStripButtonItem in toolStripItems) {
         AddToolStripButtonItem(toolStripButtonItem);
-      }      
+      }
     }
 
@@ -117,5 +133,5 @@
 
       SetToolStripItemProperties(item, buttonItem);
-      ToolStripDropDownItem parent = FindParent(buttonItem,toolStrip.Items);
+      ToolStripDropDownItem parent = FindParent(buttonItem, toolStrip.Items);
       if (parent == null)
         toolStrip.Items.Add(item);
@@ -142,4 +158,8 @@
       toolStripItem.Image = iToolStripItem.Image;
       toolStripItem.DisplayStyle = iToolStripItem.DisplayStyle;
+      if (iToolStripItem.ListenActiveViewChanged)
+        this.ActiveViewChanged += new EventHandler(iToolStripItem.ActiveViewChanged);
+      if (iToolStripItem.ListenViewStateChanged)
+        this.viewStateChangeToolStripItems.Add(iToolStripItem);
       toolStripItem.Click += new EventHandler(ToolStripItemClicked);
       iToolStripItem.ToolStripItem = toolStripItem;
Index: /trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.Designer.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.Designer.cs	(revision 2254)
@@ -34,5 +34,4 @@
       this.Name = "MultipleDocumentMainForm";
       this.ResumeLayout(false);
-
     }
 
Index: /trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs	(revision 2254)
@@ -29,5 +29,5 @@
 
     private void MultipleDocumentFormActivated(object sender, EventArgs e) {
-      base.activeView = ((MultipleDocumentForm)sender).View;
+      base.ActiveView = ((MultipleDocumentForm)sender).View;
       base.StatusStripText = ((MultipleDocumentForm)sender).View.Caption;
     }
@@ -37,5 +37,5 @@
       openViews.Remove(form.View);
       if (openViews.Count == 0)
-        activeView = null;
+        ActiveView = null;
       form.Activated -= new EventHandler(MultipleDocumentFormActivated);
       form.FormClosing -= new FormClosingEventHandler(MultipleDocumentFormClosing);
Index: /trunk/sources/HeuristicLab.MainForm/3.2/ToolStripItemBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/ToolStripItemBase.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/ToolStripItemBase.cs	(revision 2254)
@@ -55,4 +55,17 @@
       get { return ToolStripMenuItemBase.structureSeparator; }
     }
+
+    public virtual bool ListenActiveViewChanged {
+      get { return false; }
+    }
+    public virtual bool ListenViewStateChanged {
+      get { return false; }
+    }
+
+    public virtual void ActiveViewChanged(object sender, EventArgs e) {
+    }
+
+    public virtual void ViewStateChanged(object sender, EventArgs e) {
+    }
     #endregion
   }
Index: /trunk/sources/HeuristicLab.MainForm/3.2/ViewBase.cs
===================================================================
--- /trunk/sources/HeuristicLab.MainForm/3.2/ViewBase.cs	(revision 2253)
+++ /trunk/sources/HeuristicLab.MainForm/3.2/ViewBase.cs	(revision 2254)
@@ -57,4 +57,10 @@
     }
 
+    public event EventHandler StateChanged;
+    protected virtual void OnStateChanged() {
+      if (StateChanged != null)
+        StateChanged(this, new EventArgs());
+    }
+
     private IMainForm mainForm;
     public IMainForm MainForm {
@@ -62,5 +68,4 @@
       set { this.mainForm = value; }
     }
-
   }
 }
