Changeset 10103 for branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
- Timestamp:
- 11/04/13 10:15:31 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
r10093 r10103 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Drawing; 25 26 using System.Linq; … … 41 42 viewsLabel.Visible = false; 42 43 viewsLabelVisible = true; 44 IsValidOutermostViewhost = true; 43 45 44 46 breadcrumbControl.ViewHost = this; … … 59 61 60 62 public bool HotlinkingEnabled { get; set; } 63 64 [DefaultValue(true)] 65 public bool IsValidOutermostViewhost { get; set; } 61 66 62 67 private IContentView cachedView; … … 132 137 } 133 138 134 private bool isOutermostViewHost;135 139 public IEnumerable<IContent> Breadcrumbs { get { return breadcrumbControl.Breadcrumbs; } } 136 140 … … 281 285 282 286 private void UpdateBreadcrumbControl() { 283 breadcrumbControl.Visible = ShowBreadcrumbs ;287 breadcrumbControl.Visible = ShowBreadcrumbs && Content != null; 284 288 if (ShowBreadcrumbs) 285 289 UpdateBreadcrumbTrail(breadcrumbControl.Breadcrumbs, BuildBreadcrumbTrail()); … … 378 382 379 383 private void PerformOutermostViewHostDetection() { 384 if (!IsValidOutermostViewhost) return; 380 385 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; 385 389 } 386 390 #endregion
Note: See TracChangeset
for help on using the changeset viewer.