Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/04/13 10:15:31 (11 years ago)
Author:
jkarder
Message:

#2116:

  • fixed issues within the outermost control detection
  • fixed visible property assignment of the breadcrumb control in ViewHost
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs

    r10093 r10103  
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.Drawing;
    2526using System.Linq;
     
    4142      viewsLabel.Visible = false;
    4243      viewsLabelVisible = true;
     44      IsValidOutermostViewhost = true;
    4345
    4446      breadcrumbControl.ViewHost = this;
     
    5961
    6062    public bool HotlinkingEnabled { get; set; }
     63
     64    [DefaultValue(true)]
     65    public bool IsValidOutermostViewhost { get; set; }
    6166
    6267    private IContentView cachedView;
     
    132137    }
    133138
    134     private bool isOutermostViewHost;
    135139    public IEnumerable<IContent> Breadcrumbs { get { return breadcrumbControl.Breadcrumbs; } }
    136140
     
    281285
    282286    private void UpdateBreadcrumbControl() {
    283       breadcrumbControl.Visible = ShowBreadcrumbs;
     287      breadcrumbControl.Visible = ShowBreadcrumbs && Content != null;
    284288      if (ShowBreadcrumbs)
    285289        UpdateBreadcrumbTrail(breadcrumbControl.Breadcrumbs, BuildBreadcrumbTrail());
     
    378382
    379383    private void PerformOutermostViewHostDetection() {
     384      if (!IsValidOutermostViewhost) return;
    380385      var mainForm = MainFormManager.GetMainForm<MainForm>();
    381       if (mainForm == null) return;
    382       var outermostViewHost = mainForm.GetOutermostViewOfType<ViewHost>(this);
    383       isOutermostViewHost = outermostViewHost == this;
    384       viewContextMenuStrip.ShowBreadcrumbsToolStripMenuItem.Checked = isOutermostViewHost;
     386      if (mainForm == null) return; // needed for designer
     387      var outermostViewHost = mainForm.GetOutermostControlOfType<ViewHost>(this);
     388      viewContextMenuStrip.ShowBreadcrumbsToolStripMenuItem.Checked = outermostViewHost == this;
    385389    }
    386390    #endregion
Note: See TracChangeset for help on using the changeset viewer.